0
bitcoin > bitcoin-cli listaccounts
{
"": 5648.99996160
}
bitcoin > bitcoin-cli getaccountaddress ""
mui4xgNgZBr3XhdL4dDDHkRFEvSXZmSi7t
bitcoin > bitcoin-cli getreceivedbyaddress mui4xgNgZBr3XhdL4dDDHkRFEvSXZmSi7t
0.00000000
I expect it will return 5648.99996160 after calling 'getreceivedbyaddress'.
Thank you! However I still get problem. I call RPC getaddressesbyaccount and get 3 addresses. Then I call RPC getreceivedbyaddress for each 3 address, but the result are all 0.00000000. – Anderson – 2017-11-22T09:24:08.223
Did you send money to any of those 3 addresses? – Pieter Wuille – 2017-11-22T09:24:28.830
No. However, I expect one of the addresses should have money because the result of RPC "listaccounts" shows there is money in the account. – Anderson – 2017-11-23T06:04:58.153
getreceivedbyaddress shows (surprise!) how much was received by the address. If you literally tell me you never sent money to any of them, then by definition the response should be 0. There are plenty of other ways through which the account may have been credited before. – Pieter Wuille – 2017-11-23T06:11:40.783
Like what kind of ways? Does it related to regtest mode?(because I am using regtest mode) – Anderson – 2017-11-24T02:49:29.153
1You could have received money using a
getnewaddresscall before any of those 3, or using themovecommand you can move money from other accounts (even if that makes those others negative). – Pieter Wuille – 2017-11-24T03:57:21.653