RPC problem; getbalance is broken.
On a mintcoind fresh from git checkout, with synced blockchain:
someone@somebox:~$ mintcoind listaccounts
{
"" : 0.00000000,
"gamebank" : 999999.00000000
}
someone@somebox:~$ mintcoind getbalance gamebank
-9216810327147.70507812
someone@somebox:~$ mintcoind getbalance test
-9216811327146.70507812
This is incorrect. getbalance gamebank should return 999999.0, and getbalance test should return 0.
what os you use? I tried on windows, looks fine to me. It did show my balance.
Yes I see the problem now. The problem only exist if you specific the account name. If you do "mintcoind getbalance", then it shows total correctly, but if you use "mintcoind getbalance acctname" then the displayed number is wrong.
So for your purpose, just use getblance without further arguments, it will be fine.
You don't understand my use case.
I'm a service provider and need this RPC call functional.
Edit: Opened a
GitHub issueIf you check coins like Peercoin, there's only functions like getbalance of the whole wallet. You may have several addresses, its own balance usually do not make sense. As when you do a send, the coins may come from multiple of the addresses randomly. You can not say send from this address. Therefore, all you care about is the balance in your wallet in this case. If you want to check each address. Use listaccounts.
getbalance should work with seperate accounts. You can send coins to and from accounts within one wallet, and use getbalance to retrieve the total number of coins from those accounts. I know because I use getbalance regularly with other coins. Many altcoins in fact.
If you're running a service accounts are essential. As someone who has a script that relies on knowing exact account balances on a regular basis I can confirm that if he's unable to get the correct balance from his accounts, then either there's a problem on his end, or with the source.
No, these are not separate "accounts", these are different addresses of the same wallet. It is mainly useful to track the receive amount of that address. When you send payout, you have no control where the amount from which address it uses. Sometimes you can see the balance of one address being negative while your whole balance is positive. So it does not make sense to get the balance from each addresses. You have a wallet balance, that's all.
If you are just curious of which balance in which address, then use listaccounts to see them. Again this does not make sense as you may see negative values there.
If you want to track which address you received how much, use the transaction list and filter on that address. This is the proper way to track received amounts.