Mempool persistence was added in 3f78562df5e86a2a0a21812047fc3a7db8cee988, and is always on. This commit introduces a command-line parameter -persistmempool, which defaults to true. When set to false:
- mempool.dat is not loaded when the node starts.
- mempool.dat is not written when the node stops.
This was suggested in the PR that introduced mempool persistence (https://github.com/bitcoin/bitcoin/pull/8448#issuecomment-237155942 and #8448 (comment)) , but wasn’t implemented in the original PR. It is a pre-req for fixing #9710.
This PR also introduces tests for mempool persistence, as well as for the new command-line parameter.