mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Merge #15323: rpc: Expose g_is_mempool_loaded via getmempoolinfo
effe81f750Move g_is_mempool_loaded into CTxMemPool::m_is_loaded (Ben Woosley)bb8ae2c419rpc: Expose g_is_mempool_loaded via getmempoolinfo and /rest/mempool/info.json (Ben Woosley) Pull request description: And use it to fix a race condition in mempool_persist.py: https://travis-ci.org/Empact/bitcoin/jobs/487577243 Since e.g. getrawmempool returns errors based on this status, this enables users to test it for readiness. Fixes #12863 ACKs for commit effe81: MarcoFalke: utACKeffe81f750jnewbery: utACKeffe81f750Tree-SHA512: 74328b0c17a97efb8a000d4ee49b9a673c2b6dde7ea30c43a6a2eff961a233351c9471f9a42344412135786c02bdf2ee1b2526651bb8fed68bd94d2120c4ef86
This commit is contained in:
@@ -241,8 +241,8 @@ void Shutdown(InitInterfaces& interfaces)
|
||||
g_txindex.reset();
|
||||
DestroyAllBlockFilterIndexes();
|
||||
|
||||
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)
|
||||
@@ -735,9 +735,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
|
||||
|
||||
Reference in New Issue
Block a user