-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getbalance API call returns incorrect values with account parameter #3002
Comments
Getbalance is returning the default account "", if you want all accounts use the argument "*". It's possible for an account to have a negative balance if you've spent more from it than you have assigned to that account. |
I didn't assigned anything to accounts. This was done automatically by regular bitcoin-qt usage. How can I recalculate balances? |
Just use the move command to move the funds from the accounts back to "". |
Thanks. This helped. But anyway I didn't use "move" ever. This mess in accounts appeared by itself. |
Assigning labels to addresses in the gui attributes their funds to the various accounts. |
Right. But seems it do it wrong. |
Should accounts match the label everytime? They don't match for me either... |
bitcoind accounts and Bitcoin-Qt labels are not designed to be consistent with each other. Use one or the other, not both at the same time. |
@gavinandresen Well it's at least intersting to have accounts, with names I never set by using Bitcoin-Qt, no? I have no clue about the concept of labels, just asking :). |
No, they don't need to match. For historical purposes labels and accounts use the same underlying information in the database but in different ways. I guess that should be changed some day, but doing that and keeping backwards compatibility (neither losing your labels nor accounts) will at least require a lot of testing. |
Im getting the same error. I have never used labels, always accounts. This seems to return the total inputed. Not taking into account any sends. |
Are you using sendfrom/sendmany with the account names in question? |
Thanks for getting back. I just did a send from(account name) and it sent from different addresses in the wallet. Not just the one associated with the account name. |
No need to load 25 quorums when we're scanning for the larger quorums which only have 4 active quorums. This avoids loading thousands of masternode lists unnecessarily.
No need to load 25 quorums when we're scanning for the larger quorums which only have 4 active quorums. This avoids loading thousands of masternode lists unnecessarily.
In some reason my wallet accounting broken. I have total 0.1 BTC on wallet and getbalance without params returns correct value.
But when I provide account to this api call (i.e. empty account), it returns incorrect values - greater than overall balance or even negative.
-rescan and -updatewallet - both didn't help. It show absolutely unreal values in listaccounts balances.
[user@localhost ~]$ bin/bitcoind getinfo
{
"version" : 80500,
"protocolversion" : 70001,
"walletversion" : 10500,
"balance" : 0.10000000,
"blocks" : 258337,
"timeoffset" : -1,
"connections" : 8,
"proxy" : "",
"difficulty" : 112628548.66634709,
"testnet" : false,
"keypoololdest" : 1327805721,
"keypoolsize" : 101,
"paytxfee" : 0.00000000,
"errors" : ""
}
[user@localhost ~]$ bin/bitcoind getbalance
0.10000000
[user@localhost ~]$ bin/bitcoind getbalance ''
-20231.03669102
[user@localhost ~]$ bin/bitcoind listaccounts
{
"" : -20231.03669102,
"acc_" : 0.00000000,
"acc_" : 50.00000000,
"acc_" : 0.00000000,
"acc_" : 7.00000000,
"acc_" : 50.00000000,
"acc_" : 5905.00000000,
}
==RAW HTTP==
<--- getbalance[ no params ]
POST / HTTP/1.1
User-Agent: bitcoin-json-rpc/v0.8.5-beta
Host: 127.0.0.1
Content-Type: application/json
Content-Length: 43
Connection: close
Accept: application/json
Authorization: Basic *************
{"method":"getbalance","params":[],"id":1}
------>
HTTP/1.1 200 OK
Date: Mon, 16 Sep 2013 15:15:18 +0000
Connection: close
Content-Length: 42
Content-Type: application/json
Server: bitcoin-json-rpc/v0.8.5-beta
{"result":0.10000000,"error":null,"id":1}
<--- getbalance[ "" ]
POST / HTTP/1.1
User-Agent: bitcoin-json-rpc/v0.8.5-beta
Host: 127.0.0.1
Content-Type: application/json
Content-Length: 45
Connection: close
Accept: application/json
Authorization: Basic *****************
{"method":"getbalance","params":[""],"id":1}
------>
HTTP/1.1 200 OK
Date: Mon, 16 Sep 2013 15:16:15 +0000
Connection: close
Content-Length: 47
Content-Type: application/json
Server: bitcoin-json-rpc/v0.8.5-beta
{"result":-20231.03669102,"error":null,"id":1}
The text was updated successfully, but these errors were encountered: