Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 231 Lines • ▼ Show 20 Lines | void Shutdown() { | ||||
// After the threads that potentially access these pointers have been | // After the threads that potentially access these pointers have been | ||||
// stopped, destruct and reset all to nullptr. | // stopped, destruct and reset all to nullptr. | ||||
peerLogic.reset(); | peerLogic.reset(); | ||||
g_connman.reset(); | g_connman.reset(); | ||||
g_banman.reset(); | g_banman.reset(); | ||||
g_txindex.reset(); | g_txindex.reset(); | ||||
if (g_is_mempool_loaded && | if (::g_mempool.IsLoaded() && | ||||
gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) { | gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) { | ||||
DumpMempool(); | DumpMempool(::g_mempool); | ||||
} | } | ||||
// FlushStateToDisk generates a ChainStateFlushed callback, which we should | // FlushStateToDisk generates a ChainStateFlushed callback, which we should | ||||
// avoid missing | // avoid missing | ||||
if (pcoinsTip != nullptr) { | if (pcoinsTip != nullptr) { | ||||
FlushStateToDisk(); | FlushStateToDisk(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 951 Lines • ▼ Show 20 Lines | ScheduleBatchPriority(); | ||||
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 | ||||
if (gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) { | if (gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) { | ||||
LoadMempool(config); | LoadMempool(config, ::g_mempool); | ||||
} | } | ||||
g_is_mempool_loaded = !fRequestShutdown; | ::g_mempool.SetIsLoaded(!fRequestShutdown); | ||||
} | } | ||||
/** Sanity checks | /** Sanity checks | ||||
* Ensure that Bitcoin is running in a usable environment with all | * Ensure that Bitcoin is running in a usable environment with all | ||||
* necessary library support. | * necessary library support. | ||||
*/ | */ | ||||
static bool InitSanityCheck() { | static bool InitSanityCheck() { | ||||
if (!ECC_InitSanityCheck()) { | if (!ECC_InitSanityCheck()) { | ||||
▲ Show 20 Lines • Show All 1,291 Lines • Show Last 20 Lines |