From 9479f8dfcf0533366ba81d191b507a0326df66db Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Thu, 22 Dec 2016 20:11:26 +0100 Subject: Allow shutdown during LoadMempool, dump only when necessary --- src/init.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/init.cpp') 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 fRequestShutdown(false); +std::atomic 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 vImportFiles) } } // End scope of CImportingNow LoadMempool(); + fDumpMempoolLater = !fRequestShutdown; } /** Sanity checks -- cgit v1.2.3