Move g_is_mempool_loaded into CTxMemPool::m_is_loaded

So the loaded state is explicitly mempool-specific.
This commit is contained in:
Ben Woosley
2019-03-07 09:54:44 -05:00
parent bb8ae2c419
commit effe81f750
6 changed files with 38 additions and 20 deletions

View File

@@ -235,8 +235,8 @@ void Shutdown(InitInterfaces& interfaces)
g_banman.reset();
g_txindex.reset();
if (g_is_mempool_loaded && gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
DumpMempool();
if (::mempool.IsLoaded() && gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
DumpMempool(::mempool);
}
if (fFeeEstimatesInitialized)
@@ -725,9 +725,9 @@ static void ThreadImport(std::vector<fs::path> vImportFiles)
}
} // End scope of CImportingNow
if (gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
LoadMempool();
LoadMempool(::mempool);
}
g_is_mempool_loaded = !ShutdownRequested();
::mempool.SetIsLoaded(!ShutdownRequested());
}
/** Sanity checks