Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | if (::g_mempool.IsLoaded() && | ||||
gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) { | gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) { | ||||
DumpMempool(::g_mempool); | DumpMempool(::g_mempool); | ||||
} | } | ||||
// FlushStateToDisk generates a ChainStateFlushed callback, which we should | // FlushStateToDisk generates a ChainStateFlushed callback, which we should | ||||
// avoid missing | // avoid missing | ||||
// g_chainstate is referenced here directly (instead of | // g_chainstate is referenced here directly (instead of | ||||
// ::ChainstateActive()) because it may not have been initialized yet. | // ::ChainstateActive()) because it may not have been initialized yet. | ||||
{ | |||||
LOCK(cs_main); | |||||
if (g_chainstate && g_chainstate->CanFlushToDisk()) { | if (g_chainstate && g_chainstate->CanFlushToDisk()) { | ||||
g_chainstate->ForceFlushStateToDisk(); | g_chainstate->ForceFlushStateToDisk(); | ||||
} | } | ||||
} | |||||
// After there are no more peers/RPC left to give us new data which may | // After there are no more peers/RPC left to give us new data which may | ||||
// generate CValidationInterface callbacks, flush them... | // generate CValidationInterface callbacks, flush them... | ||||
GetMainSignals().FlushBackgroundCallbacks(); | GetMainSignals().FlushBackgroundCallbacks(); | ||||
// Any future callbacks will be dropped. This should absolutely be safe - if | // Any future callbacks will be dropped. This should absolutely be safe - if | ||||
// missing a callback results in an unrecoverable situation, unclean | // missing a callback results in an unrecoverable situation, unclean | ||||
// shutdown would too. The only reason to do the above flushes is to let the | // shutdown would too. The only reason to do the above flushes is to let the | ||||
▲ Show 20 Lines • Show All 2,544 Lines • Show Last 20 Lines |