Title: [BUG] Wrong balance displayed Post by: Bitsky on May 12, 2012, 02:00:28 PM I've been playing around with pywallet and dumped a private key of one of my addresses. Then I imported it into a brand new wallet and ran a rescan which worked just fine. From that wallet, I sent everything to a new address in my main wallet (via the newest client), closed the client and started my old client with a rescan again which ended up with a "Payment to yourself" entry. Looking at the transaction details, the debit and credit values are identical, without any fees.
At that point I noticed that my balance was less than before. So I started a XP machine without network and opened the backup wallet and the current wallet in the 0.6.2 client (without a blockchain). The difference is exactly 0.018btc. To investigate this, I exported all transactions of both wallets into two csv files, opened them in a spreadsheet and summed up the transactions: both results are identical, not missing the 0.018btc. It seems like the client has a bug when it sums up transactions which contain a transaction to yourself. Also, it does not display the receiving address/account, making it impossible to keep track of the target. Even if I search for the address I sent the coins to in the transaction list there are no results. However blockexplorer.com/blockchain.info show the address; it would be really handy to have the official client diplay it too. Title: Re: [BUG] Wrong balance displayed Post by: SomeoneWeird on May 12, 2012, 02:18:10 PM I've been playing around with pywallet and dumped a private key of one of my addresses. Then I imported it into a brand new wallet and ran a rescan which worked just fine. From that wallet, I sent everything to a new address in my main wallet (via the newest client), closed the client and started my old client with a rescan again which ended up with a "Payment to yourself" entry. Looking at the transaction details, the debit and credit values are identical, without any fees. At that point I noticed that my balance was less than before. So I started a XP machine without network and opened the backup wallet and the current wallet in the 0.6.2 client (without a blockchain). The difference is exactly 0.018btc. To investigate this, I exported all transactions of both wallets into two csv files, opened them in a spreadsheet and summed up the transactions: both results are identical, not missing the 0.018btc. It seems like the client has a bug when it sums up transactions which contain a transaction to yourself. Also, it does not display the receiving address/account, making it impossible to keep track of the target. Even if I search for the address I sent the coins to in the transaction list there are no results. However blockexplorer.com/blockchain.info show the address; it would be really handy to have the official client diplay it too. Make sure you have all the blocks in your client. Title: Re: [BUG] Wrong balance displayed Post by: Bitsky on May 12, 2012, 02:28:57 PM Make sure you have all the blocks in your client. Blockcount doesn't really matter. As said, I checked without a blockchain and network access. The sums are just listed as unconfirmed instead.Title: Re: [BUG] Wrong balance displayed Post by: SomeoneWeird on May 12, 2012, 03:32:41 PM Make sure you have all the blocks in your client. Blockcount doesn't really matter. As said, I checked without a blockchain and network access. The sums are just listed as unconfirmed instead.It does matter. Title: Re: [BUG] Wrong balance displayed Post by: Gavin Andresen on May 12, 2012, 03:52:00 PM Do you get different answers for 'getbalance' versus 'getbalance "*"' ?
There is a longstanding issue with they way unconfirmed transactions are counted that might be the source of your problem: https://github.com/bitcoin/bitcoin/issues/172 Title: Re: [BUG] Wrong balance displayed Post by: Bitsky on May 12, 2012, 05:18:44 PM Do you get different answers for 'getbalance' versus 'getbalance "*"' ? getbalance() returns the wrong balance, lacking 0.018btc in my casegetbalance("*") returns the correct value, just like summing everything up in a spreadsheet does Quote getbalance and getbalance '*' can return different amounts for 0-confirmation transactions, because of the way change transactions are counted. However, the blockchain is up to date and the transaction is confirmed.Since I wasn't too clear about it in my first post, I sent more than the 0.018btc. Sorry if that caused a confusion. Is "(n/a)" instead of the target address in the transaction window normal? Title: Re: [BUG] Wrong balance displayed Post by: SomeoneWeird on May 13, 2012, 12:43:23 AM Do you get different answers for 'getbalance' versus 'getbalance "*"' ? getbalance() returns the wrong balance, lacking 0.018btc in my casegetbalance("*") returns the correct value, just like summing everything up in a spreadsheet does Quote getbalance and getbalance '*' can return different amounts for 0-confirmation transactions, because of the way change transactions are counted. However, the blockchain is up to date and the transaction is confirmed.Since I wasn't too clear about it in my first post, I sent more than the 0.018btc. Sorry if that caused a confusion. Is "(n/a)" instead of the target address in the transaction window normal? I'm not really sure about how the different accounts in a wallet work but maybe that's your problem. |