HomePhabricator

rpc: Remove mempool global from miner

Description

rpc: Remove mempool global from miner

Summary:

The miner needs read-only access to the mempool. Instead of using the
mutable global ::mempool, keep a immutable reference to a mempool that
is passed to the miner. Apart from the obvious benefits of removing a
global and making things immutable, this might also simplify testing
with multiple mempools.

Backport of core PR17781.

Depends on D7984.

This differs quite a bit from the original PR because we already passed
a mempool. This is mostly rename and factorization to make it looks more
like core.

Test Plan:

ninja all check-all
ninja bench-bitcoin

With clang:

ninja check

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Subscribers: jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D7988

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Jul 3 2019, 13:46
FabienCommitted on Oct 20 2020, 06:32
FabienPushed on Oct 20 2020, 06:32
Reviewer
Restricted Project
Differential Revision
D7988: rpc: Remove mempool global from miner
Parents
rABCeb0c5503515d: [CI] Improve the error snippet in diffs when a test fails
Branches
Unknown
Tags
Unknown