not always clear to user that coins already spent when restoring old wallet backup #1184

issue rebroad opened this issue on May 2, 2012
  1. rebroad commented at 6:32 PM on May 2, 2012: contributor

    This is a feature request, and also a BIP, but curious to hear feedback at this stage.

    To summarise, if for some reason, a user is using an old version of their wallet.dat, and without realising they make a transaction which tries to use coins already spent, currently the client doesn't alert the user of what they have done, they will simply (as I understand it) see that the transaction takes forever to confirm. (please correct me if I am incorrect).

    My suggestion is that when a node sees such invalid transactions, rather than simply ignore them, it sends a message back to the originating node to let them know it was invalid. This should only be necessary in situations where the transaction creating node isn't up to date on the block chain, otherwise the originating wallet should presumeably already alert the user, or ideally, have corrected their balance before they even tried to spend the coins. (A -rescan, IMHO, should do this, but, in my experience, it doesn't).

    edit@laanwj: clarified title

  2. rebroad commented at 3:25 AM on February 27, 2014: contributor

    Interesting. This issue kinda explains how mtgox might have been able to lose all their bitcoins - has bitcoin-qt now at least been fixed so that this doesn't happen any longer?

  3. gmaxwell commented at 3:36 AM on February 27, 2014: contributor

    Please don't spread misinformation. This can't make you lose Bitcoin.

    It's also not a bug, if your node is not up to sync with the network and you're on an old wallet.dat it cannot know the coins have been spent. Current versions of the software will show those hopeless TXN as conflicted with -1 confirms.

  4. laanwj commented at 6:40 AM on February 27, 2014: member

    ... why would one reply "interesting" to your own issue in the first place ...

    Restoring old backups can make you lose coins in only one way: because they won't contain the keys for addresses that have been generated since. This is why it is mentioned in about every newbie guide about bitcoind/bitcoin-qt that regular backups should be made of the wallet.

    The keys in your wallet determine solely what coins you have access to, transactions are only stored in the wallet for efficiency. When double-spending or using a wallet in multiple places, the wallet can get confused which coins are spent and which are not. That cannot result in any permanent loss. There are tools for removing transactions from your wallet, for example, -zapwallettxes that was added recently, but there have been external tools out there forever like pywallet that can do this. Followed by a rescan this will leave only confirmed transactions.

    This also has nothing to do with mtgox. They aren't even using our software. It is unknown what happened to them at this point, so insinuating that some 'interesting' issue that you posted 2 years ago caused their loss of coins is extremely irresponsible.

  5. rebroad commented at 7:00 PM on February 27, 2014: contributor

    @gmaxwell yes, current version does this, but 2 years ago it didn't. My question was, when was this changed? And I disagree, this bug of course can contribute to one losing coins since it makes the wallet balance seem higher than it is, so humans seeing this might assume they have the number of coins as shown in the balance when in fact they have less. @laanwj "transactions are only stored in the wallet for efficiency" - what are you implying by saying this? That people shouldn't depend on the transactions as being accurate as the wallet isn't designed for this purpose? This is pretty big disclaimer if so, and really should be displayed in all places where people might be relying on this information as being accurate.

    I don't see where the irresponsibility that you suggest is - I think it's irresponsible to not be taking this more seriously.

  6. gmaxwell commented at 7:12 PM on February 27, 2014: contributor

    Not seeing transactions you already made is a temporary behavior that goes away as the wallet finishes syncing. Once you have finished syncing your balance is correct— before then it will be incorrect this behavior has not changed and cannot change.

  7. rebroad commented at 12:41 AM on March 2, 2014: contributor

    @gmaxwell Sorry, perhaps I wasn't clear. This was an issue that occured when the blockchain is up to date.

  8. laanwj closed this on May 18, 2015

  9. suprnurd referenced this in commit 3ebcb78e12 on Dec 5, 2017
  10. lateminer referenced this in commit 30706de725 on Jan 22, 2019
  11. lateminer referenced this in commit 23313ac4f5 on Jan 10, 2020
  12. Bushstar referenced this in commit 0b0efb742a on Nov 12, 2020
  13. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 18:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me