Changeset View
Changeset View
Standalone View
Standalone View
src/node/blockstorage.cpp
Show First 20 Lines • Show All 962 Lines • ▼ Show 20 Lines | ScheduleBatchPriority(); | ||||
// We can't hold cs_main during ActivateBestChain even though we're | // We can't hold cs_main during ActivateBestChain even though we're | ||||
// accessing the chainman unique_ptrs since ABC requires us not to be | // accessing the chainman unique_ptrs since ABC requires us not to be | ||||
// holding cs_main, so retrieve the relevant pointers before the ABC | // holding cs_main, so retrieve the relevant pointers before the ABC | ||||
// call. | // call. | ||||
for (Chainstate *chainstate : | for (Chainstate *chainstate : | ||||
WITH_LOCK(::cs_main, return chainman.GetAll())) { | WITH_LOCK(::cs_main, return chainman.GetAll())) { | ||||
BlockValidationState state; | BlockValidationState state; | ||||
if (!chainstate->ActivateBestChain(config, state, nullptr)) { | if (!chainstate->ActivateBestChain(state, nullptr)) { | ||||
LogPrintf("Failed to connect best block (%s)\n", | LogPrintf("Failed to connect best block (%s)\n", | ||||
state.ToString()); | state.ToString()); | ||||
StartShutdown(); | StartShutdown(); | ||||
return; | return; | ||||
} | } | ||||
} | } | ||||
if (args.GetBoolArg("-stopafterblockimport", | if (args.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 | ||||
chainman.ActiveChainstate().LoadMempool(config, mempool_path); | chainman.ActiveChainstate().LoadMempool(mempool_path); | ||||
} | } | ||||
} // namespace node | } // namespace node |