Make m_mempool
an optional pointer in PeerManager, instead of a reference.
- This is a prerequisite for the introduction of a
-nomempool
option. (To run a node with just libbitcoinkernel and a minimal P2P stack to receive blocks) - The mempool is already treated optional in pretty much every other part of the codebase (validation, RPC, …), so doing it consistently is preferable.
- Removing the requirement of PeerManager to hold a reference to a mempool makes (unit/fuzz) testing easier if there is a test that doesn’t need the mempool. Also, it makes the coupling of CTxMemPool and PeerManager a bit more loose.
Picked up from #22850