Function <getbalance> return previously spent satoshis (i.e. double counting)
****NOTE: Issue only occurs when accounts are specified (i.e. <getbalance 0 1>) but no error occurs when total balance is requested (i.e. <getbalance * 1>)
To reproduce:
- Send satoshis to address on account A (e.g. 0.01 BTC)
- Spend satoshis (e.g. send 0.01 BTC to address on account B)
- Send new satoshis to address on account A (e.g. 0.02 BTC)
- Call <getbalance> (it return 0.03BTC)
Example: On 22 JUL 2014, I make a transfer of all balance on <testnet> from address: mia8ujFiaor9CcL5tLJM7NSQBmHmbFU2Vc (account 1) to address: muTXdCf4tvsBcM2kvmmbPDiZjcFbNTCAB5 (other account) TxId: 81c2591e83917d5dc0f19258de7c96a8b0b222767f2383b49fc52086730a298f
<getbalance> reports 1.5165 BTC on account 1 despite it having 0 BTC
Afterwhich, I transfer back the full amount from address: muTXdCf4tvsBcM2kvmmbPDiZjcFbNTCAB5 (other accout) to address: n4fq4EvrKy4rPazYfvKfP8gijZsRwh9FRo (account 1) TxId: bca4be28260b98870980f42c5d708476462d82ebf3a119d87401a747560a1439
<getbalance> reports 2.1045 BTC on account 1 despite it having 0.588 BTC
Bitcoind version: v0.9.2.1-g354c0f3-beta (64-bit) All calls made via modified json-rpc API and tested in console, giving the same results.