HomePhabricator

miner: Make mempool optional for BlockAssembler

Description

miner: Make mempool optional for BlockAssembler

Summary:
...also adjust callers

Changes:

  • In BlockAssembler::CreateNewBlock, we now only lock m_mempool->cs and call addPackageTxs if m_mempool is not nullptr
  • BlockAssembler::addPackageTxs now takes in a mempool reference, and is annotated to require that mempool's lock.
  • In TestChain100Setup::CreateBlock and generateblock, don't construct an empty mempool, just pass in a nullptr for mempool

This is a backport of core#25223

The first two commits of the PR are not applicable due to removal of CPFP code (see D13116, D13122)

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Carl Dong <contact@carldong.me>Authored on May 26 2022, 02:06
PiRKCommitted on Jan 25 2024, 14:12
PiRKPushed on Jan 25 2024, 14:12
Reviewer
Restricted Project
Differential Revision
D15280: miner: Make mempool optional for BlockAssembler
Parents
rABCf0543b834adb: [ecash-herald] Parse v0 paybutton txs
Branches
Unknown
Tags
Unknown