Fixes #8433 and builds upon #8392.
This adds a file mempool.dat
to the data directory, which is created every 10 minutes, and at shutdown. At startup, it is loaded after loading/reindexing/activation of blocks (in the background).
It only grabs a mempool lock while copying and sorting mempool shared pointers (similar to responding to a mempool
BIP35 message), which takes 50-100ms here for 1 GB mempool. Loading from disk seems to take up to dozens of seconds but happens in the background.