mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Bugfix: RPC: savemempool: Don't save until LoadMempool() is finished
This commit is contained in:
@@ -116,7 +116,6 @@ static const char* FEE_ESTIMATES_FILENAME="fee_estimates.dat";
|
||||
//
|
||||
|
||||
std::atomic<bool> fRequestShutdown(false);
|
||||
std::atomic<bool> fDumpMempoolLater(false);
|
||||
|
||||
void StartShutdown()
|
||||
{
|
||||
@@ -208,7 +207,7 @@ void Shutdown()
|
||||
threadGroup.interrupt_all();
|
||||
threadGroup.join_all();
|
||||
|
||||
if (fDumpMempoolLater && gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
|
||||
if (g_is_mempool_loaded && gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
|
||||
DumpMempool();
|
||||
}
|
||||
|
||||
@@ -692,8 +691,8 @@ void ThreadImport(std::vector<fs::path> vImportFiles)
|
||||
} // End scope of CImportingNow
|
||||
if (gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
|
||||
LoadMempool();
|
||||
fDumpMempoolLater = !fRequestShutdown;
|
||||
}
|
||||
g_is_mempool_loaded = !fRequestShutdown;
|
||||
}
|
||||
|
||||
/** Sanity checks
|
||||
|
||||
Reference in New Issue
Block a user