wallet: rpc: Deprecate `removeprunedfunds` RPC #35605

pull davidgumberg wants to merge 2 commits into bitcoin:master from davidgumberg:2025-06-25-deprecate-removeprunedfunds changing 6 files +101 −68
  1. davidgumberg commented at 10:59 PM on June 25, 2026: contributor

    Originally added in #7558 as a companion to importprunedfunds, this RPC has no known helpful use while being both dangerous and a maintenance burden.

    Despite what the name says, it allows the deletion of arbitrary transactions, and importprunedfunds does not allow the importing of transactions not belonging to the user, and listtransactions does not list transactions not belonging to the wallet, so this RPC can only be used to delete transactions actually belonging to the wallet, and in the unlikely event that transactions not belonging to the wallet are present, they cause no harm except for occupying a few bytes on the users disk.

  2. DrahtBot added the label Wallet on Jun 25, 2026
  3. DrahtBot commented at 10:59 PM on June 25, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35605.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK achow101
    Stale ACK pablomartin4btc

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #19461 (multiprocess: Add bitcoin-gui -ipcconnect option by ryanofsky)
    • #19460 (multiprocess: Add bitcoin-wallet -ipcconnect option by ryanofsky)
    • #10102 (Multiprocess bitcoin by ryanofsky)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. davidgumberg force-pushed on Jun 25, 2026
  5. DrahtBot added the label CI failed on Jun 25, 2026
  6. DrahtBot commented at 11:12 PM on June 25, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task lint: https://github.com/bitcoin/bitcoin/actions/runs/28205807916/job/83556135158</sub> <sub>LLM reason (✨ experimental): CI failed due to ruff Python lint errors (unused imports, F401) in test/functional/wallet_resendwallettransactions.py.</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  7. DrahtBot removed the label CI failed on Jun 26, 2026
  8. in doc/release-notes-removeprunedfunds.md:1 in 661a4dbf68
       0 | @@ -0,0 +1,12 @@
       1 | +RPC
    


    pablomartin4btc commented at 6:10 PM on June 26, 2026:

    nit (if you have to retouch)

    Updated RPCs
    

    davidgumberg commented at 12:36 AM on June 27, 2026:

    Thanks, fixed.

  9. in doc/release-notes-removeprunedfunds.md:10 in 661a4dbf68
       5 | +
       6 | +The `removeprunedfunds` RPC has been deprecated and will be removed in the next
       7 | +major release.
       8 | +
       9 | +In order to continue using it, `bitcoind` must be started with the
      10 | +`deprecatedrpc=removeprunedfunds
    


    pablomartin4btc commented at 6:16 PM on June 26, 2026:
    `deprecatedrpc=removeprunedfunds`.
    

    davidgumberg commented at 12:36 AM on June 27, 2026:

    Thanks, fixed.

  10. in doc/release-notes-removeprunedfunds.md:12 in 661a4dbf68
       7 | +major release.
       8 | +
       9 | +In order to continue using it, `bitcoind` must be started with the
      10 | +`deprecatedrpc=removeprunedfunds
      11 | +
      12 | +---
    


    pablomartin4btc commented at 6:20 PM on June 26, 2026:

    davidgumberg commented at 12:36 AM on June 27, 2026:

    I thought maybe this was necessary since i was using two lines for one change, looking at past release notes people always use one line / top level bullet point, so I just switched to doing that, thanks.

  11. in doc/release-notes-removeprunedfunds.md:5 in 661a4dbf68
       0 | @@ -0,0 +1,12 @@
       1 | +RPC
       2 | +------------
       3 | +
       4 | +---
       5 | +
    


    pablomartin4btc commented at 6:20 PM on June 26, 2026:
  12. in src/wallet/rpc/backup.cpp:98 in 661a4dbf68
      94 | @@ -95,6 +95,7 @@ RPCMethod removeprunedfunds()
      95 |  {
      96 |      return RPCMethod{
      97 |          "removeprunedfunds",
      98 | +        "DEPRECATION WARNING: This feature will be removed in the next major release. Start bitcoind with the `-deprecatedrpc=removeprunedfunds` option in order to use this.\n"
    


    pablomartin4btc commented at 9:07 PM on June 26, 2026:

    nit (please check https://github.com/bitcoin/bitcoin/pull/31278/changes/bf194c920cf768d1339d41aef1441a78e2f5fcbe):

            "(DEPRECATED) This feature will be removed in the next major release. Start bitcoind with the `-deprecatedrpc=removeprunedfunds` option in order to use this.\n"
    

    davidgumberg commented at 12:40 AM on June 27, 2026:

    Thanks, taken.

  13. in test/functional/wallet_deprecated_removeprunedfunds.py:31 in 661a4dbf68
      26 | +        node.createwallet("super_secure_wallet")
      27 | +        wallet = node.get_wallet_rpc("super_secure_wallet")
      28 | +        self.generatetoaddress(node, nblocks=COINBASE_MATURITY + 1, address=wallet.getnewaddress(), sync_fun=self.no_op)
      29 | +        tx_to_remove = wallet.listunspent()[0]["txid"]
      30 | +
      31 | +        print(f"tx to remove: {tx_to_remove}")
    


    pablomartin4btc commented at 9:15 PM on June 26, 2026:

    was this part of a test?


    davidgumberg commented at 12:40 AM on June 27, 2026:

    Oops, thanks for catching!

  14. in test/functional/wallet_deprecated_removeprunedfunds.py:43 in 661a4dbf68 outdated
      38 | +        self.log.info("Test calling removeprunedfunds with -deprecatedrpc=removeprunedfunds")
      39 | +        self.restart_node(0, extra_args=["-deprecatedrpc=removeprunedfunds"])
      40 | +        node.loadwallet("super_secure_wallet")
      41 | +        wallet = node.get_wallet_rpc("super_secure_wallet")
      42 | +        wallet.removeprunedfunds(tx_to_remove)
      43 | +
    


    pablomartin4btc commented at 9:19 PM on June 26, 2026:

    Perhaps you can add an assert_raises_rpc_error on wallet.gettransaction(tx_to_remove) after the call to confirm the RPC actually does what it says.


    davidgumberg commented at 12:40 AM on June 27, 2026:

    Ah, I tried to think of something here that was very simple and short but couldn't think of that, (I went in the direction of balances and decided it wasn't worth it) thanks for the suggestion! I've taken it.

  15. pablomartin4btc commented at 9:20 PM on June 26, 2026: member

    ACK 661a4dbf689f65a7f10fb3d1753ffc8c58be3563

    I think the removeprunedfunds RPC was designed to remove non-wallet transactions imported via importprunedfunds, but since importprunedfunds only imports wallet transactions, the only thing removeprunedfunds can actually delete is your own wallet transactions. So it's dangerous with no real use case.

    Perhaps the description should reference the original PR #7558 / v0.13.0, when the RPCs were added.

    nit: typo in commit 2 body: "delte" → "delete".

    non blocker: I thought release notes file should have the PR number just to make it easier to identify it but it seems it's not mandatory as the consolidation process is done manually.

  16. achow101 commented at 10:40 PM on June 26, 2026: member

    Concept ACK

  17. davidgumberg force-pushed on Jun 27, 2026
  18. test: wallet: resend: avoid internal behavior via removeprunedfunds
    Currently this test makes assumptions about `listtransaction` exposing a
    wallet-internal data structure `mapWallet` That is not guaranteed or
    enforced anywhere. Ideally, this would live in a unit test instead of a
    functional test, but as a half-measure to simplify the test, just check
    the behavior 10 times, if there are any dependencies on random ordering
    inside of a wallet data structure, this is likely to catch them.
    e5b7785447
  19. davidgumberg force-pushed on Jun 27, 2026
  20. DrahtBot added the label CI failed on Jun 27, 2026
  21. davidgumberg force-pushed on Jun 27, 2026
  22. wallet: rpc: deprecate removeprunedfunds
    This RPC has no helpful use while being both dangerous and a maintenance
    burden.
    
    Despite what the name says, it allows the deletion of arbitrary
    transactions, and `importprunedfunds` does not allow the importing of
    transactions not belonging to the user, and `listtransactions` does not
    list transactions not belonging to the wallet, so this RPC can only be
    used to delete transactions actually belonging to the wallet, and in the
    unlikely event that transactions not belonging to the wallet are
    present, they cause no harm except for occupying a few bytes on the
    users disk.
    44c3268c76
  23. davidgumberg force-pushed on Jun 27, 2026
  24. davidgumberg commented at 12:43 AM on June 27, 2026: contributor

    (sorry for all the pushes :O )

    Pushed to address @pablomartin4btc's feedback.

  25. DrahtBot removed the label CI failed on Jun 27, 2026

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-06-27 06:51 UTC

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