Skip to content

Commit e4e7c44

Browse files
committed
fix: use proper chain instead using ActiveChain for test framework
1 parent 65b92fa commit e4e7c44

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/miner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ BlockAssembler::Options::Options()
6464
}
6565

6666
BlockAssembler::BlockAssembler(CChainState& chainstate, const NodeContext& node, const CTxMemPool& mempool, const CChainParams& params, const Options& options) :
67-
m_blockman(Assert(node.chainman)->m_blockman),
67+
m_blockman(chainstate.m_blockman),
6868
m_cpoolman(*Assert(node.cpoolman)),
69-
m_chain_helper(*Assert(node.chain_helper)),
69+
m_chain_helper(chainstate.ChainHelper()),
7070
m_chainstate(chainstate),
7171
m_dmnman(*Assert(node.dmnman)),
7272
m_evoDb(*Assert(node.evodb)),

src/test/util/setup_common.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,10 +428,10 @@ CBlock TestChainSetup::CreateBlock(
428428
auto cbTx = GetTxPayload<CCbTx>(*block.vtx[0]);
429429
BOOST_ASSERT(cbTx.has_value());
430430
BlockValidationState state;
431-
if (!CalcCbTxMerkleRootMNList(block, m_node.chainman->ActiveChain().Tip(), cbTx->merkleRootMNList, *m_node.dmnman, state, m_node.chainman->ActiveChainstate().CoinsTip())) {
431+
if (!CalcCbTxMerkleRootMNList(block, chainstate.m_chain.Tip(), cbTx->merkleRootMNList, *m_node.dmnman, state, chainstate.CoinsTip())) {
432432
BOOST_ASSERT(false);
433433
}
434-
if (!CalcCbTxMerkleRootQuorums(block, m_node.chainman->ActiveChain().Tip(), *m_node.llmq_ctx->quorum_block_processor, cbTx->merkleRootQuorums, state)) {
434+
if (!CalcCbTxMerkleRootQuorums(block, chainstate.m_chain.Tip(), *m_node.llmq_ctx->quorum_block_processor, cbTx->merkleRootQuorums, state)) {
435435
BOOST_ASSERT(false);
436436
}
437437
CMutableTransaction tmpTx{*block.vtx[0]};
@@ -443,7 +443,7 @@ CBlock TestChainSetup::CreateBlock(
443443
{
444444
LOCK(cs_main);
445445
unsigned int extraNonce = 0;
446-
IncrementExtraNonce(&block, m_node.chainman->ActiveChain().Tip(), extraNonce);
446+
IncrementExtraNonce(&block, chainstate.m_chain.Tip(), extraNonce);
447447
}
448448

449449
while (!CheckProofOfWork(block.GetHash(), block.nBits, chainparams.GetConsensus())) ++block.nNonce;

0 commit comments

Comments
 (0)