Account change address is not showing up with `getaddressesbyaccount`

2

2

I have a tiny question regarding the Bitcoin JSON-RPC API. I have a transaction on Testnet which sends one coin to an other address owned by me (on an other account than the sender). The sending address, mtGaEd9zZU8B7aYSuQiDFZTo2wiS8dWb3c, is listed under the default account, running getaccount mtGaEd9zZU8B7aYSuQiDFZTo2wiS8dWb3c outputs indeed an empty string. The receiving address, mzcj8xYome3gmAWZG57yutv14sctPxbPV6, is listed under an account named test, as expected running getaccount mzcj8xYome3gmAWZG57yutv14sctPxbPV6 returns test. Both addresses also show up when I use getaddressesbyaccount, but the change that went to address mnUJRd9CL3GV1QbWFxJxLj2DgE1ADSB8oR, which also returns an emtpy string when using it as argument to getaccount, doesn't show up in the getaddressesbyaccount call output. Why is that? I can't sum the balances of each addresses now for a reliable account balance, only getbalance return the right answer.

Jori

Posted 2013-11-29T13:57:47.840

Reputation: 1 522

Answers

1

Call listreceivedbyaddress(0, true) to get all of your addresses (even the empty ones or those who have a zero-confirmations balance).

By default (parameterless) it will only list the addresses that contain some confirmed balance and those who have at least one confirmation for their unconfirmed balance.

George Kimionis

Posted 2013-11-29T13:57:47.840

Reputation: 2 824

1I believe I was talking about getaddressesbyaccount not listreceivedbyaddress. Don't get me wrong, I'm not asking a solution (getbalance works just fine), I'm trying to understand why getaddressesbyaccount does not work.Jori 2014-03-01T22:38:34.140

And why would mnUJRd9CL3GV1QbWFxJxLj2DgE1ADSB8oR have zero confirmations? It is in the same transaction as mzcj8xYome3gmAWZG57yutv14sctPxbPV6.Jori 2014-03-01T22:41:40.050

0

It doesn't show up in the results from getaddressesbyaccount() because addresses are only associated with accounts by use of getnewaddress() or setaccount().

Bitlab.co

Posted 2013-11-29T13:57:47.840

Reputation: 724

Why did they use this approach? It doesn't make sense to me. Also is there any other way to show all Bitcoin addresses?Jori 2013-11-29T19:16:32.117