gettransaction does not contain the field "abandoned" for abandoned receiving tx #25130

issue relativisticelectron opened this issue on May 13, 2022
  1. relativisticelectron commented at 3:40 PM on May 13, 2022: none

    In specter https://github.com/cryptoadvance/specter-desktop/issues/1491#issuecomment-1126145011 a user can abandon an receiving tx that was evicted from the mempool (for example because it was double spent). The tx is marked via abandontransaction as abandoned in bitcoin core.

    However gettransaction and listtransactions do not return the field abandoned, even though this is visible in the GUI:

    image

    Consequence: Specter cannot get the abandoned information from bitcoin rpc, and will fetch the abandoned tx back again via listtransactions after it was deleted in specter.

    Describe the solution you'd like Always return the abandoned field in https://github.com/bitcoin/bitcoin/blob/225e5b57b2ee2bc1acd7f09c89ccccc15ef8c85f/src/wallet/rpc/transactions.cpp#L345 and not only in this special case https://github.com/bitcoin/bitcoin/blob/225e5b57b2ee2bc1acd7f09c89ccccc15ef8c85f/src/wallet/rpc/transactions.cpp#L375 That should then automatically solve gettransaction via https://github.com/bitcoin/bitcoin/blob/225e5b57b2ee2bc1acd7f09c89ccccc15ef8c85f/src/wallet/rpc/transactions.cpp#L795

    Describe alternatives you've considered If specter can't get the information about abandoned tx from bitcoin, it would have to keep an internal list. That is possible, but redundant and can lead to many edge cases.

    Steps to reproduce

    • Wallet A: Send 1 BTC to Wallet B (rbf)
    • Wallet A: Replace tx with rbf to send all funds to wallet A
    • Wallet B: Abandon tx (because no longer in mempool)
    • Wallet B: gettransaction will not show the abandoned field
  2. relativisticelectron added the label Feature on May 13, 2022
  3. maflcko added the label Wallet on May 13, 2022
  4. brunoerg commented at 1:51 PM on May 14, 2022: contributor

    I can work on it if it gets some concept ACKs

  5. relativisticelectron commented at 4:07 PM on May 14, 2022: none

    I can work on it if it gets some concept ACKs

    Wow, that would be great. Thanks!

  6. luke-jr commented at 7:06 PM on May 18, 2022: member

    "Abandoned" means the wallet in question will attempt to re-use the inputs of the transaction, but that doesn't make any sense for transactions that aren't sent from the wallet...

  7. brunoerg commented at 7:17 PM on May 18, 2022: contributor

    @luke-jr so, why is this visible in the GUI? Do you know?

  8. luke-jr commented at 7:24 PM on May 18, 2022: member

    Likely it just checks the abandoned flag without checking if it was sent or received.

    The real bug here is probably that abandontransaction should fail.

  9. sipa commented at 7:38 PM on May 18, 2022: member

    Abandoning also means it won't be rebroadcasted anymore, I think? If so, that does make sense for received transactions too.

  10. brunoerg commented at 7:39 PM on May 18, 2022: contributor

    "Abandoned" means the wallet in question will attempt to re-use the inputs of the transaction

    I am not sure if I agree with this definition of "abandoned". But of course, it's one of the features.

  11. luke-jr commented at 9:20 PM on May 18, 2022: member

    Perhaps #25158 should change the description as well then ;)

  12. bitcoin deleted a comment on May 24, 2022
  13. achow101 closed this on Apr 26, 2023

  14. sidhujag referenced this in commit 031c0b26bd on Apr 28, 2023
  15. BlackcoinDev referenced this in commit 91ccb62faa on Feb 5, 2024
  16. bitcoin locked this on Apr 25, 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-04-13 15:13 UTC

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