Can't bump fee after abandoning child transaction #26667

issue Sjors opened this issue on December 8, 2022
  1. Sjors commented at 7:48 PM on December 8, 2022: member

    Steps:

    1. Send transaction (A) to a different wallet
    2. Using the change, create another transaction (B) to a different wallet
    3. abandontransaction B
    4. bumpfee A fails with Transaction has descendants in the wallet
  2. Sjors added the label Bug on Dec 8, 2022
  3. Sjors commented at 7:56 PM on December 8, 2022: member

    This is particularly annoying now that -zapwallettxes has been removed.

    <img width="426" alt="Scherm­afbeelding 2022-12-08 om 14 55 29" src="https://user-images.githubusercontent.com/10217/206554825-fa31ba91-73d3-4c13-94dc-b726243eef7b.png">

  4. Sjors cross-referenced this on Dec 8, 2022 from issue Bring back the zap (zaptransaction RPC) by Sjors
  5. maflcko added the label Wallet on Dec 8, 2022
  6. john-moffett commented at 10:27 PM on December 8, 2022: contributor

    Having trouble replicating. When I try to abandontransaction on B, I get:

    Transaction not eligible for abandonment (code -5)

    I'm using 24.0.

  7. Sjors commented at 11:06 PM on December 8, 2022: member

    @john-moffett that error happens because the transaction is in your mempool. One way around that is to stop the node, delete mempool.dat and start again with -connect=0 -walletbroadcast=0.

    The first argument makes it so your node doesn't connect to other peers that would echo the transaction back. The second ensures your wallet doesn't put the transaction in the mempool.

  8. john-moffett commented at 12:48 AM on December 9, 2022: contributor

    @Sjors Thank you!

    It appears that HasWalletSpend doesn't make an exception for abandoned transactions:

    https://github.com/bitcoin/bitcoin/blob/7d515600034b84ebf23346a3642cf0a714880e25/src/wallet/wallet.cpp#L646-L657

    However, IsSpent does make an exception:

    https://github.com/bitcoin/bitcoin/blob/7d515600034b84ebf23346a3642cf0a714880e25/src/wallet/wallet.cpp#L712-L727

    HasWalletSpend appears to to be used only by feebumper (and tests). I'll take a look tomorrow to see if that will fix the issue.

    On a broader level, it's unclear to me why abandontransaction won't remove transactions from the mempool and mark them as abandoned. Perhaps there ought to be a force option?

  9. achow101 commented at 2:08 AM on December 9, 2022: member

    On a broader level, it's unclear to me why abandontransaction won't remove transactions from the mempool and mark them as abandoned. Perhaps there ought to be a force option?

    Explicitly removing a transaction from our mempool has no effect on the network and could mislead users into thinking that they have "canceled" their transaction. Doing so may surprise users when the "abandoned" transaction ends up confirming, or a subsequent spend ends up not propagating because it conflicts with the abandoned transaction (that all of the other nodes still have in their mempool). However, by allowing abandoning when our own mempool has dropped the transaction, we can more safely assume that other nodes have dropped the transaction as well. Abandoning in this case has a higher likelihood of the transaction actually having been forgotten by a significant portion of the network.

  10. john-moffett cross-referenced this on Dec 9, 2022 from issue wallet: For feebump, ignore abandoned descendant spends by john-moffett
  11. bitcoin deleted a comment on Dec 11, 2022
  12. achow101 closed this on Jan 11, 2023

  13. sidhujag referenced this in commit f979b164b0 on Jan 12, 2023
  14. bitcoin locked this on Jan 11, 2024

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-20 06:53 UTC