Bitcoin Forum
May 10, 2024, 07:16:24 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: 0.3.18 Bug Report on "getreceivedbyaccount" display  (Read 1578 times)
The Madhatter (OP)
Hero Member
*****
Offline Offline

Activity: 490
Merit: 509


My avatar pic says it all


View Profile
December 13, 2010, 02:54:41 PM
 #1

Hey,

Looks like the "getreceivedbyaccount" rpc display is broken on 0.3.18.

Quote
# ~/bin/bitcoind getnewaddress
1Fs5rqB2sXZ3kax1r3HfuYpK2ksSxLYJT8

* Does a 0.01 BTC spend from another computer to 1Fs5rqB2sXZ3kax1r3HfuYpK2ksSxLYJT8 *

(BBE: http://blockexplorer.com/a/7BMcTdZkY3)

Quote
# ~/bin/bitcoind getreceivedbyaccount 1Fs5rqB2sXZ3kax1r3HfuYpK2ksSxLYJT8 0
0.00000000

* Trying some PHP code to talk to the JSON-RPC directly *

Quote
# cat test.php
<?
  require "config.inc.php";
  require "functions.inc.php";

  $bitcoin=bitcoin_api_call("getamountreceived",array("1Fs5rqB2sXZ3kax1r3HfuYpK2ksSxLYJT8",0)); //0 confirmations. I've also tried 1+
  print_r($bitcoin);
?>
# php test.php
stdClass Object
(
    [result] => 0.01
    [error] =>
    [id] => 1
)

So I see the 0.01 BTC on my php client, but not on the command line. Yes, "getinfo" and other commands work. Yes, I have proper "allowrpc" command line options. Yes, I've tried waiting for confirmations. I get the exact same result.

Seems to be a problem with the display when you use the bitcoind as a client?? Can anyone confirm that they have the same problem?

OS: FreeBSD 7.2-RELEASE-p8/amd64

Thanks.
You get merit points when someone likes your post enough to give you some. And for every 2 merit points you receive, you can send 1 merit point to someone else!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715325384
Hero Member
*
Offline Offline

Posts: 1715325384

View Profile Personal Message (Offline)

Ignore
1715325384
Reply with quote  #2

1715325384
Report to moderator
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5194
Merit: 12982


View Profile
December 13, 2010, 04:41:26 PM
 #2

You should be using getreceivedbyaddress rather than getreceivedbyaccount. You didn't assign that address to any account.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652
Merit: 2216


Chief Scientist


View Profile WWW
December 13, 2010, 05:10:06 PM
 #3

You should be using getreceivedbyaddress rather than getreceivedbyaccount. You didn't assign that address to any account.

What theymos said.  You're asking for the balance of the account named '1Fs5rqB2sXZ3kax1r3HfuYpK2ksSxLYJT8', and there is no such account.

Whether bitcoin should return an error (instead of 0) if you ask for the balance of a non-existant account is debatable...

How often do you get the chance to work on a potentially world-changing project?
davout
Legendary
*
Offline Offline

Activity: 1372
Merit: 1007


1davout


View Profile WWW
December 13, 2010, 08:26:59 PM
 #4

Whether bitcoin should return an error (instead of 0) if you ask for the balance of a non-existant account is debatable...

I vote for "it should", 0 should be the answer for when an account balance is actually zero

The Madhatter (OP)
Hero Member
*****
Offline Offline

Activity: 490
Merit: 509


My avatar pic says it all


View Profile
December 14, 2010, 12:06:05 AM
 #5

You should be using getreceivedbyaddress rather than getreceivedbyaccount. You didn't assign that address to any account.

What is the difference between an address and an account? Are they not the same thing? In version 0.3.13 they seem to perform the same function.
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5194
Merit: 12982


View Profile
December 14, 2010, 12:44:19 AM
 #6

What is the difference between an address and an account? Are they not the same thing? In version 0.3.13 they seem to perform the same function.

"Label" was renamed to "account" recently. Addresses are grouped into accounts.

Lots of people have been confusing "address" and "account". The name should be changed to something more clear.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
The Madhatter (OP)
Hero Member
*****
Offline Offline

Activity: 490
Merit: 509


My avatar pic says it all


View Profile
December 14, 2010, 12:49:15 AM
 #7

Ahh, ok. Thanks for clearing that up. Smiley
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!