Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 1,378 Lines • ▼ Show 20 Lines | ScheduleBatchPriority(); | ||||
LogPrintf("Reconsidering checkpointed block %s ...\n", | LogPrintf("Reconsidering checkpointed block %s ...\n", | ||||
hash.GetHex()); | hash.GetHex()); | ||||
ResetBlockFailureFlags(pblockindex); | ResetBlockFailureFlags(pblockindex); | ||||
} | } | ||||
} | } | ||||
// scan for better chains in the block chain database, that are not yet | // scan for better chains in the block chain database, that are not yet | ||||
// connected in the active best chain | // connected in the active best chain | ||||
// We can't hold cs_main during ActivateBestChain even though we're | |||||
// accessing the g_chainman unique_ptrs since ABC requires us not to be | |||||
// holding cs_main, so retrieve the relevant pointers before the ABC | |||||
// call. | |||||
for (CChainState *chainstate : | |||||
WITH_LOCK(::cs_main, return g_chainman.GetAll())) { | |||||
BlockValidationState state; | BlockValidationState state; | ||||
if (!ActivateBestChain(config, state)) { | if (!chainstate->ActivateBestChain(config, state, nullptr)) { | ||||
LogPrintf("Failed to connect best block (%s)\n", state.ToString()); | LogPrintf("Failed to connect best block (%s)\n", | ||||
state.ToString()); | |||||
StartShutdown(); | StartShutdown(); | ||||
return; | return; | ||||
} | } | ||||
} | |||||
if (gArgs.GetBoolArg("-stopafterblockimport", | if (gArgs.GetBoolArg("-stopafterblockimport", | ||||
DEFAULT_STOPAFTERBLOCKIMPORT)) { | DEFAULT_STOPAFTERBLOCKIMPORT)) { | ||||
LogPrintf("Stopping after block import\n"); | LogPrintf("Stopping after block import\n"); | ||||
StartShutdown(); | StartShutdown(); | ||||
return; | return; | ||||
} | } | ||||
} // End scope of CImportingNow | } // End scope of CImportingNow | ||||
▲ Show 20 Lines • Show All 1,480 Lines • Show Last 20 Lines |