Skip to content

Commit f0dd5e6

Browse files
committed
test/util: Use existing chainman in ::PrepareBlock
1 parent 464c313 commit f0dd5e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/util/mining.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ CTxIn MineBlock(const NodeContext& node, const CScript& coinbase_scriptPubKey)
7474
std::shared_ptr<CBlock> PrepareBlock(const NodeContext& node, const CScript& coinbase_scriptPubKey)
7575
{
7676
auto block = std::make_shared<CBlock>(
77-
BlockAssembler{::ChainstateActive(), *Assert(node.mempool), Params()}
77+
BlockAssembler{Assert(node.chainman)->ActiveChainstate(), *Assert(node.mempool), Params()}
7878
.CreateNewBlock(coinbase_scriptPubKey)
7979
->block);
8080

8181
LOCK(cs_main);
82-
block->nTime = ::ChainActive().Tip()->GetMedianTimePast() + 1;
82+
block->nTime = Assert(node.chainman)->ActiveChain().Tip()->GetMedianTimePast() + 1;
8383
block->hashMerkleRoot = BlockMerkleRoot(*block);
8484

8585
return block;

0 commit comments

Comments
 (0)