aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2020-10-14 17:00:00 -0400
committerCarl Dong <contact@carldong.me>2021-06-10 15:04:39 -0400
commitf0dd5e6bb4b16e69d35b648b7ef973a732229873 (patch)
treea826c86bd8f6ad474a7d75205075e63602beec47 /src
parent464c313e304cef04a82e14f736e3c44ed5604a4e (diff)
test/util: Use existing chainman in ::PrepareBlock
Diffstat (limited to 'src')
-rw-r--r--src/test/util/mining.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/util/mining.cpp b/src/test/util/mining.cpp
index 1204873828..f6a11bc02e 100644
--- a/src/test/util/mining.cpp
+++ b/src/test/util/mining.cpp
@@ -74,12 +74,12 @@ 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{::ChainstateActive(), *Assert(node.mempool), Params()}
+ BlockAssembler{Assert(node.chainman)->ActiveChainstate(), *Assert(node.mempool), Params()}
.CreateNewBlock(coinbase_scriptPubKey)
->block);
LOCK(cs_main);
- block->nTime = ::ChainActive().Tip()->GetMedianTimePast() + 1;
+ block->nTime = Assert(node.chainman)->ActiveChain().Tip()->GetMedianTimePast() + 1;
block->hashMerkleRoot = BlockMerkleRoot(*block);
return block;