ZapWalletTxes should backup the wallet #9275

issue gmaxwell opened this issue on December 4, 2016
  1. gmaxwell commented at 8:10 PM on December 4, 2016: contributor

    Consider the case where the user has many outstanding unconfirmed transactions which are viable and will confirm. After hitting the depth limit, they read some bad advice on the internet and zap. Now they've lost information about all their payments. At a minimum zap should be backing up the wallet like salvage does.

    (really zap should be made harder to use foolishly too-- esp now what we have abandon and will presumably have bump sometime soon)

  2. fanquake added the label Wallet on Dec 5, 2016
  3. laanwj commented at 11:50 AM on December 5, 2016: member

    The default zap keeps metadata, right?

    The throw-away-everything variant could probably be changed to a salvagewallet mode, or even better moved to an external tool e.g. #8745).

  4. jonasschnelli commented at 12:46 PM on December 5, 2016: contributor

    I agree it should backup the wallet.

    -zapwallettxes(=1) does keep the metadata. Though, the transactions(-metadata) are hold in memory during the time of the wallet-recreation, if something goes wrong there, all tx-metadata is lost.

    -zapwallettxes(=2) does always erase metadata thus backup in a such case would be desirable.

  5. gmaxwell commented at 2:06 AM on December 9, 2016: contributor

    Even keeping the metadata is still a destructive operation-- for all the unconfirmed transactions which don't show back up.

    I encountered someone who was making payments end ended up with dozens of unconfirmed ones at one point before running into the unconfirmed chain limit. When his transactions stopped relaying he responded by running zapwallettxes based on a forum post.

    This made his wallet forget all the unconfirmed payments. He then continued using the wallet, making more payments, -- some of which doublespent the prior ones. Resulting in a state where he had no idea what was paid, potentially paid, double paid, or not paid at all.-- or what double-spent with what (since he didn't even know what he'd signed before).

    Fortunately in his case he has backed up the wallet first, so the information was all recoverable. But I was horrified enough to open this issue. :)

  6. MarcoFalke commented at 2:49 PM on August 10, 2022: member
    $ ./src/bitcoind -zapwallettxes 
    Error: -zapwallettxes has been removed. If you are attempting to remove a stuck transaction from your wallet, please use abandontransaction instead.
    
  7. MarcoFalke closed this on Aug 10, 2022

  8. bitcoin locked this on Aug 10, 2023

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-18 21:15 UTC

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