mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
test/util: Use existing chainman in ::PrepareBlock
This commit is contained in:
parent
464c313e30
commit
f0dd5e6bb4
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue