aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2016-12-22 20:11:26 +0100
committerJonas Schnelli <dev@jonasschnelli.ch>2016-12-23 14:19:38 +0100
commit9479f8dfcf0533366ba81d191b507a0326df66db (patch)
tree2b7515f830f6f8765a40ab31f7a032ecfe0e68f4 /src/init.cpp
parent041331e1da23e4136fd046ed870cdcc177464176 (diff)
Allow shutdown during LoadMempool, dump only when necessary
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp5
1 files changed, 4 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