Someone else mentioned this bug last week, and I've been chasing it since.
I might have found a bug
...removed...
Yippieh, so I did find a bug. Is there a bug finding bounty?
Well, actually I had already completed the fix and submitted it to devs when I read your message. The bug was reported on Mar 17th, and I started tracking it on 18th. About bounties, I really don't know, I'm just a supporter
when I notice a bug that I can fix, I try to fix it and send a patch to devs
To be fair, this was the message that led me to investigate the bug:
Is this a Mintcoin specific bug - or do you want to tell all the other PoS coins, too?
Probably other PoS coins suffer from closely-related bugs but not exactly the same. The whole altcoin scene is forks from each other, and each fork starts developing/patching itself independently and drifting away from each other. So well, when the patch enters github, PoS altcoin devs can check the diff and apply it to their own codebase if they're affected.
With the latest Cryptorush / BC issue, I learned that PoS coins are known to have problems with "getbalance accountname" calls, and those calls should not be trusted on exchanges/services, although BC did not have this issue until their wallet update / blockchain fork. I don't know about the other coins actually, with so many forks out there, it's very hard to keep track of who fixes what. I just get irritated when I notice a bug in the wallet, and try to fix what I have in front of me.
How much code do mintcoin and blackcoin actually share?
Might this "wrong balance" bug be connected to the wrong balances at cryptorush?
It is probably same bug that caused cryptorush's problems, but they did not have it on previous versions as I read on IRC logs. I don't know why. Codebases drift from each other.
Wallet's total balance, shown in UI and also in "getbalance" call without parameters is always correct (MINT and BC and other coins). But wallet contains an accounting facility (giving account names to receiving addresses), and then it can report each account balance individually. It can send funds from a specific account or move funds between accounts in the same wallet. As long as the totals sum up to wallet's balance, an account might have negative balance and another account positive balance. The problem was related with that accounting facility -- cryptorush trusted that accounts would work, and used a single wallet's accounting features instead of a database, when in fact the system didn't work properly (in their case after the update/fork). The total wallet balance was always correct, but when individual accounts within the wallet is queried, they didn't sum up (or have the funds moved between each other).
In MINT case, the total wallet balance was and is always correct, but when individual accounts are queried, totals don't sum up if minting is involved. Now to the point; although the patch makes the "getbalance accountname", "getbalance *", "listaccounts" commands consistent with each other and total wallet balance ("getbalance") ;
if you're planning on starting a financial service, don't trust wallet's account balances features but only the total balance of the wallet. This holds for all coins (maybe except for bitcoin as it has enough development power and always leads the fixes/updates/features). When I was trying to fix the bug, I saw that per-account functionality is implemented a little crappy (at least in the coin MINT forked from, which in turn forked from another coin, which in turn forked from another coin, .., which in turn forked (and added PoS features) from an older version of bitcoin).
"getbalance" by itself can be trusted. "getbalance xxx" or others should be used informationally (or with testing throughly first), those are not production-quality code.