mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-12 13:43:43 +01:00
Allow shutdown during LoadMempool, dump only when necessary
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user