10

Using Bitcoind and Json-RPC, how can I remove an unconfirmed transaction from the memory pool?

The scenario being that I want to remove the unconfirmed transaction because it's not getting confirmed, and it's preventing me from sending new transactions spending the same inputs because Bitcoind considers it a double spend.

4 Answers 4

7

Try the removeprunedfunds RPC command. It

deletes the specified transaction from the wallet. … This will effect wallet balances.

2
  • don't know why you're voted down.. that did it for me
    – tobi
    Commented Jun 14, 2018 at 9:43
  • This is correct, but it should be noted that removeprunedfunds will remove the tx from just the local node's mempool and not necessarily from the mempool of other nodes that the tx may have propagated to.
    – A-Diddy
    Commented Oct 4, 2021 at 17:22
1

I haven't found a good way to clear just a single transaction from the mempool, but you can shutdown bitcoind and then delete ~/.bitcoin/mempool.dat and clear the entire mempool, and then restart bitcoind

1

You can use prioritisetransaction to reduce the perceived effective feerate of the original transaction in your own mempool. If you lower the feerate enough, and your mempool is full, it will be removed the next time transactions are evicted.

If the original transaction signaled RBF, or your node uses the mempoolfullrbf startup option (enabled by default starting with Bitcoin Core 28.0), deprioritizing the original transaction will also make it easier to replace it, since the modified feerate is used as basis to evaluate a replacement. Note that this only affects your own local mempool, and other nodes that still have the original may not accept the replacement unless it fulfills those nodes’ criteria for replacement.

0

There is no RPC command available to remove objects from the mempool.

2
  • 1
    outdated reply, see @Geremia's answer
    – tobi
    Commented Jun 14, 2018 at 10:59
  • Not really. Removal from wallet and removal from mempool are two distinct operations. Commented Sep 17, 2020 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.