Bitcoin Forum
June 24, 2017, 12:32:32 AM *
News: Latest stable version of Bitcoin Core: 0.14.2  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: 0.3.18 Bug Report on "getreceivedbyaccount" display  (Read 1372 times)
The Madhatter
Hero Member
*****
Offline Offline

Activity: 490


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.
POLONIEX TRADING SIGNALS
+50% Profit and more via TELEGRAM
ALTCOINTRADER.CO
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1498264352
Hero Member
*
Offline Offline

Posts: 1498264352

View Profile Personal Message (Offline)

Ignore
1498264352
Reply with quote  #2

1498264352
Report to moderator
1498264352
Hero Member
*
Offline Offline

Posts: 1498264352

View Profile Personal Message (Offline)

Ignore
1498264352
Reply with quote  #2

1498264352
Report to moderator
1498264352
Hero Member
*
Offline Offline

Posts: 1498264352

View Profile Personal Message (Offline)

Ignore
1498264352
Reply with quote  #2

1498264352
Report to moderator
theymos
Administrator
Legendary
*
expert
Offline Offline

Activity: 2702


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


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


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
Hero Member
*****
Offline Offline

Activity: 490


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
*
expert
Offline Offline

Activity: 2702


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
Hero Member
*****
Offline Offline

Activity: 490


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:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!