Author

Topic: Bitcoin API "getbalance" for a spesific account is invalid. (Read 1595 times)

kjj
legendary
Activity: 1302
Merit: 1026
The basic problem is that accounts and addresses do not in any way work the way you think they work.

Bitcoin accounts have no concept of "available".  They aren't for that.  The wallet as a whole has "available", but accounts do not.
full member
Activity: 222
Merit: 100
BTCRaven.com Escrow & Advertising
Solved. Move function does work, I had odd numbers spread out all over, negative numbers etc.
full member
Activity: 222
Merit: 100
BTCRaven.com Escrow & Advertising
For example... the following API/PHP code:
Quote
$main='1CbXKAKwV1173nNoopT5dFbwin2us9kJo5';
print("Current Balance: ".$bitcoin->getbalance()."
");
$accountname="main";
print_r($bitcoin->getbalance($accountname,0)."
");
print_r($bitcoin->getbalance($accountname,1)."
");
print_r($bitcoin->getbalance($accountname,10)."
");
print_r($bitcoin->getbalance($accountname,100)."
");
print_r($bitcoin->getbalance($accountname,1000)."
");
print_r($bitcoin->getbalance($accountname,10000)."
");
print_r($bitcoin->getbalance($accountname,100000)."
");
print_r($bitcoin->getbalance($accountname,1000000)."
");
print_r($bitcoin->getbalance($accountname,10000000)."
");
print_r($bitcoin->getbalance($accountname,99999999999)."
");
print_r($bitcoin->getbalance($accountname,999999999999)."
");
print_r($bitcoin->getbalance($accountname,9999999999999)."
");

will result in a strange inconsistent:
Quote
Current Balance: 0.35959594
53.11832942
53.11832942
53.11832942
53.09431754
52.95047184
41.96723348
0.3664962
0.3664962
0.3664962
0.3664962
53.11832942
0.3664962

Why is it uneven?
Why does the number of verifications more or less return different account balances?
My TRUE current balance is 0.35959594
full member
Activity: 222
Merit: 100
BTCRaven.com Escrow & Advertising
Hello.

I am testing bitcoind on my server and I noticed some API calls are wrong.
For example "getaccountaddress" is listed to "Returns the current bitcoin address for receiving payments to this account. "
However it creates a NEW address in your wallet and gives it the same account name.  This cannot be right.
But I dont care about that one.

I do care about having multiple "accounts" and getting the current ~available~ balance.
Bitcoind API seems INCAPABLE of telling you the current available balance for an account.
"Getbalance" will only show the available balance for your entire wallet, OR All the coin you have EVER received for a specific account, but not the current balance for a specific account.

I have looked on google to see other people with the same problem and no solution.
Yet other websites can take my bitcoin address and tell me how much I have in my account currently.

How can I get the current balance for one of the many different "accounts"?

(Also the "move" API function does nothing at all.)
Jump to: