@@ -3775,6 +3775,7 @@ bool CChainState::AcceptBlock(const std::shared_ptr<const CBlock>& pblock, Block
37753775bool ChainstateManager::ProcessNewBlock (const CChainParams& chainparams, const std::shared_ptr<const CBlock> pblock, bool fForceProcessing , bool * fNewBlock )
37763776{
37773777 AssertLockNotHeld (cs_main);
3778+ assert (std::addressof (::ChainstateActive ()) == std::addressof (ActiveChainstate ()));
37783779
37793780 {
37803781 CBlockIndex *pindex = nullptr ;
@@ -3790,18 +3791,18 @@ bool ChainstateManager::ProcessNewBlock(const CChainParams& chainparams, const s
37903791 bool ret = CheckBlock (*pblock, state, chainparams.GetConsensus ());
37913792 if (ret) {
37923793 // Store to disk
3793- ret = :: ChainstateActive ().AcceptBlock (pblock, state, chainparams, &pindex, fForceProcessing , nullptr , fNewBlock );
3794+ ret = ActiveChainstate ().AcceptBlock (pblock, state, chainparams, &pindex, fForceProcessing , nullptr , fNewBlock );
37943795 }
37953796 if (!ret) {
37963797 GetMainSignals ().BlockChecked (*pblock, state);
37973798 return error (" %s: AcceptBlock FAILED (%s)" , __func__, state.ToString ());
37983799 }
37993800 }
38003801
3801- NotifyHeaderTip (:: ChainstateActive ());
3802+ NotifyHeaderTip (ActiveChainstate ());
38023803
38033804 BlockValidationState state; // Only used to report errors, not invalidity - ignore it
3804- if (!:: ChainstateActive ().ActivateBestChain (state, chainparams, pblock))
3805+ if (!ActiveChainstate ().ActivateBestChain (state, chainparams, pblock))
38053806 return error (" %s: ActivateBestChain failed (%s)" , __func__, state.ToString ());
38063807
38073808 return true ;
0 commit comments