Page MenuHomePhabricator

node: Add reference to mempool in NodeContext
ClosedPublic

Authored by deadalnix on Jun 7 2020, 16:41.

Details

Reviewers
majcosta
Group Reviewers
Restricted Project
Commits
rABC6aad0088cfc5: 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

This revision is now accepted and ready to land.Jun 7 2020, 22:37