wallet showing incorrect (too high) balance #1164

Closed
rebroad opened this Issue Apr 29, 2012 · 11 comments

Projects

None yet

6 participants

@rebroad

Wallet balance is incorrect. I have totalled the transactions, and these match the total of the amounts in my bitcoin addresses. The balance is showing much more than both of these, so I know it is incorrect.

It first went above the correct value upon running a bitcoin-qt -rescan

@Diapolo

As you have opened quite a few issues over the last days, could you please give more details. Used version, OS and perhaps the difference you found out ... what is displayed and what was your sum? Thanks!

@sipa
Bitcoin member

does getbalance also report the incorrect balance? what about getbalance "*"? Or is it only limited to the GUI?

@rebroad

Now running 0.6.1 RC1 and still reporting incorrect balance in the GUI, but now against unconfirmed rather than balance. However, I'm not up to date on the chain, so will update this when I am.

@laanwj
Bitcoin member

Have you checked, does this still happen when you are up to date?

@ripper234

Happens to me with Bitcoin 0.6.3.

I switched the wallet file a few times, then ran bitcoin --rescan (old version of Bitcoin) and bitcoin-qt --rescan (Bitcoin 0.6.3).

Only now I realized the correct switch is -rescan and not --rescan.
Still, I don't understand why the balance displayed should be lower than the sum of all transactions shown in the GUI.

@rebroad

This is still happening with 0.7.0. It causing bitcoins I've sent to not be confirmed. The block has caught up to 12 days beyond the transactions that sent the money, and they're still showing as unconfirmed. It should be able to determine that it tried using spent coins, and invalidate them instead of forever showing them as unconfirmed, surely?

@gmaxwell
Bitcoin member

@rebroad You haven't provided enough information to determine the cause of your problem or to reproduce it.

An incorrect balance display won't cause it to produce invalid transactions— the only ways I'm aware of to cause that is to run the same wallet on multiple systems or restoring a backup and sending before its caught up with the pre-restore transactions; perhaps you have two issues.

@rebroad

@gmaxwell I think it's one cause. i.e. probably caused by running the same wallet on multiple systems, but more than one symptom as a result. Are issues linked to number of causes or number of symptoms? I'd like to think the former, and if so, it's therefore only one issue, certainly one solution, IMHO. The solution I propose is that this can be (and should be) fixed during the -rescan operation, whereby the balance should be corrected based upon the transaction history for the addresses in the wallet. Also, as a matter of course, whenever a transaction is found to be invalid (due to the inputs having already been used), it should be shown as invalid, rather than remain "unconfirmed", IMHO.

@gmaxwell
Bitcoin member

It would be disastrous for a rescan to remove transactions that the wallet knows about. That particular proposal is a non-starter. (identifying conflicted txn and providing a facility to remove them would be great, but it must never erase accounting records on its own). Though I can't think of how this would cause a too-high balance: even if you have payments to yourself they shouldn't be included unless they're confirmed. If it is I'm fairly sure it's another bug.

@rebroad

I would like to help troubleshoot this issue. I still have the wallet.dat file which shows the incorrect balance - the balance is too high and totals more than the total of all the transactions. Regardless of how I created this problem, surely the balances should equate to the total of the transactions in all cases.

@laanwj
Bitcoin member

Should be fixed in 0.9.0 (by #3694), as the spendable outputs are now computed on the fly instead of stored in the wallet.

@laanwj laanwj added the Wallet label May 13, 2014
@laanwj laanwj closed this May 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment