aboutsummaryrefslogtreecommitdiff
path: root/src/test/util/mining.cpp
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2022-05-25 22:06:23 -0400
committerCarl Dong <contact@carldong.me>2022-06-06 15:38:09 -0400
commit0f1a259657280afc727db97689512aef5ca928fc (patch)
treedf44289c04dd3c24f631b92399c1c6a02811f4ae /src/test/util/mining.cpp
parentcc5739b27df830d138119eaa13f2286d91d0dadd (diff)
miner: Make mempool optional for BlockAssembler
...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
Diffstat (limited to 'src/test/util/mining.cpp')
-rw-r--r--src/test/util/mining.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/util/mining.cpp b/src/test/util/mining.cpp
index a6d624fe84..88cf9647e7 100644
--- a/src/test/util/mining.cpp
+++ b/src/test/util/mining.cpp
@@ -77,7 +77,7 @@ CTxIn MineBlock(const NodeContext& node, const CScript& coinbase_scriptPubKey)
std::shared_ptr<CBlock> PrepareBlock(const NodeContext& node, const CScript& coinbase_scriptPubKey)
{
auto block = std::make_shared<CBlock>(
- BlockAssembler{Assert(node.chainman)->ActiveChainstate(), *Assert(node.mempool)}
+ BlockAssembler{Assert(node.chainman)->ActiveChainstate(), Assert(node.mempool.get())}
.CreateNewBlock(coinbase_scriptPubKey)
->block);