Skip to content

Commit 5e4af77

Browse files
committed
validation: Use existing chain member in CChainState::AcceptBlock
1 parent fee7334 commit 5e4af77

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/validation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3787,8 +3787,9 @@ bool CChainState::AcceptBlock(const std::shared_ptr<const CBlock>& pblock, Block
37873787

37883788
// Write block to history file
37893789
if (fNewBlock) *fNewBlock = true;
3790+
assert(std::addressof(::ChainActive()) == std::addressof(m_chain));
37903791
try {
3791-
FlatFilePos blockPos = SaveBlockToDisk(block, pindex->nHeight, ::ChainActive(), chainparams, dbp);
3792+
FlatFilePos blockPos = SaveBlockToDisk(block, pindex->nHeight, m_chain, chainparams, dbp);
37923793
if (blockPos.IsNull()) {
37933794
state.Error(strprintf("%s: Failed to find position to write new block to disk", __func__));
37943795
return false;

0 commit comments

Comments
 (0)