abandoned (invalid) wtx remains in wallet causing subsequent conflicts #13277

issue HashUnlimited opened this issue on May 18, 2018
  1. HashUnlimited commented at 2:18 PM on May 18, 2018: contributor

    Messing around with my test wallet, I was running into an interesting issue:

    Creating a tx but failing to sign we are ending up here:

    https://github.com/bitcoin/bitcoin/blob/1b53e4f67c6dbefadbfda7e40948840fe2b9da48/src/wallet/wallet.cpp#L3142

    Now that the tx does not make it to the mempool, it can be abandoned. Afterwards the next transaction, which is using some of the same inputs, will be marked conflicted with that abandoned wtx. So I was endig up with a perfectly fine wallet in terms of inputs but unable to spend those used and abandoned. The only way out of the situation was starting over with a new wallet, import and so on...

  2. MarcoFalke commented at 2:26 PM on May 18, 2018: member

    Can you explain the code path where you create a transaction, it fails to sign and then commits that "failed" tx. I couldn't immediately see how that is possible.

  3. HashUnlimited commented at 2:32 PM on May 18, 2018: contributor

    I'm trying to reproduce that first step now, shouldn't have scrapped the wallet file.....

  4. HashUnlimited commented at 5:51 PM on May 18, 2018: contributor

    Well unfortunately atm I am unable to reproduce the entry point to the situation, it must have had something to do with me testing some external code (still buggy) serving a wallet by frequently creating raw transactions and at the same time playing on another one which got one of the privkeys in as well.

    Found a wallet backup with lots of subsequently conflicted but due to it's size the backtrace is pretty hard. Since you can't see the way to get there either, I will keep that one in case you guys are one day working on the TODO comment stated in the code so I can test it, closing this one for now and will report back in case I find the exact steps.

  5. HashUnlimited closed this on May 18, 2018

  6. DrahtBot 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-05-01 03:15 UTC

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