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.

Murch
  • 75,206
  • 34
  • 186
  • 622
Flavien
  • 1,037
  • 1
  • 9
  • 17

3 Answers3

6

Try the removeprunedfunds RPC command. It

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

Geremia
  • 4,626
  • 5
  • 38
  • 75
  • don't know why you're voted down.. that did it for me – tobi Jun 14 '18 at 09: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 04 '21 at 17:22
1

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

user13413
  • 940
  • 4
  • 4
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

Earlz
  • 1,130
  • 2
  • 11
  • 27