Title: `getbalance accountname` returning incorrect amount? Post by: tgerring on August 29, 2013, 05:03:56 AM I've been swapping wallet.dat back and forth all night to simulate transactions between wallets and I'm receiving what appears to be incorrect information from `getbalance accountname` (which lists more than the wallet contains). Any idea what's going on or how to correct it? Cycling bitcoin-qt (with server=1) doesn't help. This is on testnet
Code: $ bitcoind getbalance Title: Re: `getbalance accountname` returning incorrect amount? Post by: tgerring on August 29, 2013, 02:08:00 PM Shutting down bitcoin-qt overnight and letting it catch up in the morning didn't seem to have any effect. Still not sure what to do
Title: Re: `getbalance accountname` returning incorrect amount? Post by: kjj on August 29, 2013, 07:16:13 PM Accounts can be negative.
Title: Re: `getbalance accountname` returning incorrect amount? Post by: tgerring on August 29, 2013, 08:06:20 PM Accounts can be negative. Perhaps I'm misunderstanding the use of accounts. Could you expand on that? Or happy to read any reference documentation. Title: Re: `getbalance accountname` returning incorrect amount? Post by: grue on August 29, 2013, 08:56:18 PM https://en.bitcoin.it/wiki/Accounts_explained
Title: Re: `getbalance accountname` returning incorrect amount? Post by: tgerring on August 30, 2013, 03:23:58 AM Quote The sendfrom method sends coins and debits the specified account. The wiki mentions "debits", so I understand the possibility for an account to go negative. But if new transactions to an address associated with an account act as the only credit mechanism, under what circumstances would an account show a balance more than the wallet total? Title: Re: `getbalance accountname` returning incorrect amount? Post by: theymos on August 30, 2013, 03:31:33 AM The wiki mentions "debits", so I understand the possibility for an account to go negative. But if new transactions to an address associated with an account act as the only credit mechanism, under what circumstances would an account show a balance more than the wallet total? Code: getbalance Title: Re: `getbalance accountname` returning incorrect amount? Post by: tgerring on September 05, 2013, 03:49:13 PM I'm still not sure what's going on, since I never used the `move` command, but it's apparent that the account balance is not working as expected. Since I'm mapping a single account to a single address, my workaround is to rely on `listunspent` and build a dictionary of balances. Python example:
Code: def getaccountbalances(): Title: Re: `getbalance accountname` returning incorrect amount? Post by: kjj on September 05, 2013, 05:07:36 PM I'm still not sure what's going on, since I never used the `move` command, but it's apparent that the account balance is not working as expected. This is a frequent complaint. Search the boards for many more examples of threads substantially identical to yours. Accounts do not work the way you think they do. They are not intended for the use you are attempting. Title: Re: `getbalance accountname` returning incorrect amount? Post by: tgerring on September 05, 2013, 05:35:20 PM They are not intended for the use you are attempting. Someone's got to do something at some point since this appears to be a problem not willing to go away. The code I posted was a drop-in replacement for how I expected `getbalance` to work in conjunction with `sendfrom`. Hopefully it helps someone else too. Title: Re: `getbalance accountname` returning incorrect amount? Post by: nagagaga on June 10, 2018, 12:16:13 PM I've been swapping wallet.dat back and forth all night to simulate transactions between wallets and I'm receiving what appears to be incorrect information from `getbalance accountname` (which lists more than the wallet contains). Any idea what's going on or how to correct it? Cycling bitcoin-qt (with server=1) doesn't help. This is on testnet Code: $ bitcoind getbalance Hey Im getting this error too! Do you have any idea how to solve this issue? |