How to cleanup mempool

0

I want to cleanup mempool. I googled and knew -zapwallettxes might clean up mempool.

But when I do the following command, mempool is still loaded.

./bitcoind -testnet=3 -server -rest -dbcache=4000 -txindex=1 -rpcbind=0.0.0.0 -rpcallowip=0.0.0.0/0 -printtoconsole -zapwallettxs=2 -rescan

In this situation, even if I restart bitcoind, mempool is dumped to .bitcoin/testnet3/mempool.dat and loaded on startup.

how should I clean up mempool?

Any comments and advices are welcomed :)

yoyoyousei

Posted 2018-09-07T09:24:56.067

Reputation: 3

Have you tried using the option maxmempool=N, where N is the maximum size of your mempool in megabytes?Pedro 2018-09-07T09:35:41.160

2Why are you doing this? What do you hope to accomplish by "cleaning up" the mempool?Nate Eldredge 2018-09-07T14:24:00.870

Answers

1

First of all, clearing your mempool doesn't really do anything if the transactions you're clearing have already propagated through the network. The mempool will sync again when you connect to other peers.

mempool.dat was introduced in 0.14.0 and will persist the mempool on shutdown. In order to clear the mempool you have to:

  1. Shutdown Bitcoin Core $ bitcoin-cli -testnet3 stop
  2. Delete mempool.dat $ rm ~/.bitcoin/testnet3/mempool.dat
  3. Restart the daemon $ bitcoind -testnet -zapwallettxes

Note: You might also need start the daemon with -zapwallettxes so the transactions related to your wallet aren't loaded into the mempool at startup.

Another Note: If you only want to remove transactions related to your wallet, you can skip step 2: https://github.com/bitcoin/bitcoin/pull/10330

JBaczuk

Posted 2018-09-07T09:24:56.067

Reputation: 6 172