node: Add reference to mempool in NodeContext
Summary:
Currently it is an alias to the global ::mempool and should be used as
follows.
- Node code (validation and transaction relay) can use either ::mempool or node.mempool, whichever seems a better fit.
- RPC code should use the added convenience getter EnsureMempool, which makes sure the mempool exists before use. This prepares the RPC code to a future where the mempool might be disabled at runtime or compile time.
- Test code should use m_node.mempool directly, as the mempool is always initialized for tests.
This is a partial backport of Core PR17407 : https://github.com/bitcoin/bitcoin/pull/17407/commits/fac07f2038a3ccd5edadc6e6122c02fa30e697bd
Test Plan:
ninja all check-all
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D6437