File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ CClientUIInterface uiInterface; // Declared but not defined in guiinterface.h
155155//
156156
157157volatile bool fRequestShutdown = false ;
158+ std::atomic<bool > fDumpMempoolLater (false );
158159
159160void StartShutdown ()
160161{
@@ -245,7 +246,8 @@ void PrepareShutdown()
245246 DumpBudgets (g_budgetman);
246247 DumpMasternodePayments ();
247248 UnregisterNodeSignals (GetNodeSignals ());
248- DumpMempool ();
249+ if (fDumpMempoolLater )
250+ DumpMempool ();
249251
250252 // After everything has been shut down, but before things get flushed, stop the
251253 // CScheduler/checkqueue threadGroup
@@ -703,6 +705,7 @@ void ThreadImport(std::vector<fs::path> vImportFiles)
703705 }
704706
705707 LoadMempool ();
708+ fDumpMempoolLater = !fRequestShutdown ;
706709}
707710
708711/* * Sanity checks
Original file line number Diff line number Diff line change @@ -4146,6 +4146,8 @@ bool LoadMempool(void)
41464146 } else {
41474147 ++skipped;
41484148 }
4149+ if (ShutdownRequested ())
4150+ return false ;
41494151 }
41504152 std::map<uint256, CAmount> mapDeltas;
41514153 file >> mapDeltas;
You can’t perform that action at this time.
0 commit comments