diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/init.cpp | 5 | ||||
-rw-r--r-- | src/validation.cpp | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp index e642729a99..e239e0d305 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -130,6 +130,7 @@ static const char* FEE_ESTIMATES_FILENAME="fee_estimates.dat"; // std::atomic<bool> fRequestShutdown(false); +std::atomic<bool> fDumpMempoolLater(false); void StartShutdown() { @@ -209,7 +210,8 @@ void Shutdown() StopTorControl(); UnregisterNodeSignals(GetNodeSignals()); - DumpMempool(); + if (fDumpMempoolLater) + DumpMempool(); if (fFeeEstimatesInitialized) { @@ -667,6 +669,7 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles) } } // End scope of CImportingNow LoadMempool(); + fDumpMempoolLater = !fRequestShutdown; } /** Sanity checks diff --git a/src/validation.cpp b/src/validation.cpp index bd60bbfdcd..b36e901121 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4076,6 +4076,8 @@ bool LoadMempool(void) } else { ++skipped; } + if (ShutdownRequested()) + return false; } std::map<uint256, CAmount> mapDeltas; file >> mapDeltas; |