diff --git a/src/validation.h b/src/validation.h --- a/src/validation.h +++ b/src/validation.h @@ -1051,6 +1051,9 @@ bool LoadBlockIndexDB(const Consensus::Params ¶ms) EXCLUSIVE_LOCKS_REQUIRED(cs_main); + const CBlockIndex *FindBlockToFinalize(CBlockIndex *pindexNew) + EXCLUSIVE_LOCKS_REQUIRED(cs_main); + friend ChainstateManager; }; diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2451,8 +2451,7 @@ return true; } -static const CBlockIndex *FindBlockToFinalize(CBlockIndex *pindexNew) - EXCLUSIVE_LOCKS_REQUIRED(cs_main) { +const CBlockIndex *CChainState::FindBlockToFinalize(CBlockIndex *pindexNew) { AssertLockHeld(cs_main); const int32_t maxreorgdepth = @@ -2478,7 +2477,7 @@ // While our candidate is not eligible (finalization delay not expired), try // the previous one. - while (pindex && (pindex != ::ChainstateActive().GetFinalizedBlock())) { + while (pindex && (pindex != GetFinalizedBlock())) { // Check that the block to finalize is known for a long enough time. // This test will ensure that an attacker could not cause a block to // finalize by forking the chain with a depth > maxreorgdepth.