From 5e4af773809415b71a10e3120cc44854d61c4c19 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 6 Oct 2020 16:13:36 -0400 Subject: [PATCH] validation: Use existing chain member in CChainState::AcceptBlock --- src/validation.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/validation.cpp b/src/validation.cpp index dcb88294eaf..b40e1f53b93 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3787,8 +3787,9 @@ bool CChainState::AcceptBlock(const std::shared_ptr& pblock, Block // Write block to history file if (fNewBlock) *fNewBlock = true; + assert(std::addressof(::ChainActive()) == std::addressof(m_chain)); try { - FlatFilePos blockPos = SaveBlockToDisk(block, pindex->nHeight, ::ChainActive(), chainparams, dbp); + FlatFilePos blockPos = SaveBlockToDisk(block, pindex->nHeight, m_chain, chainparams, dbp); if (blockPos.IsNull()) { state.Error(strprintf("%s: Failed to find position to write new block to disk", __func__)); return false;