9

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.

3 Answers 3

6

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
    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
    Oct 4, 2021 at 17:22
1

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

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

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

Your Answer

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

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