aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-03-30 00:25:43 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-03-30 00:26:23 +0200
commit3b62a913865777426c11992bae622fb48aa72a40 (patch)
tree4f84108616f18b0cae9fc0aeba570ef238ddc05f /src/init.cpp
parentde6bdfd78f22a8f4f51a519fe0e72dd16920156d (diff)
parentcb1e319fe9e198c9c5cf5236fe9af5a3d748b9e8 (diff)
downloadbitcoin-3b62a913865777426c11992bae622fb48aa72a40.tar.xz
Merge #12172: Bugfix: RPC: savemempool: Don't save until LoadMempool() is finished
cb1e319 Bugfix: RPC: savemempool: Don't save until LoadMempool() is finished (Jorge Timón) Pull request description: Fixes https://github.com/bitcoin/bitcoin/issues/12142 The tests are a little bit slow, mempool_persist.py goes from about 20 s to about 120 s in my hardware. Perhaps there's a better way to test this. Tree-SHA512: 9e6c24b32a9cf3774e8f0bd81c035b0deb53fba5ac3eb2532d85900579d21cef8a1135b75a4fa0a9d883e3822eb35e7d4b47a0838abf99789039205041962629
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 64b513d63a..3eb2a83243 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -115,7 +115,6 @@ static const char* FEE_ESTIMATES_FILENAME="fee_estimates.dat";
//
std::atomic<bool> fRequestShutdown(false);
-std::atomic<bool> fDumpMempoolLater(false);
void StartShutdown()
{
@@ -205,7 +204,7 @@ void Shutdown()
threadGroup.interrupt_all();
threadGroup.join_all();
- if (fDumpMempoolLater && gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
+ if (g_is_mempool_loaded && gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
DumpMempool();
}
@@ -684,8 +683,8 @@ void ThreadImport(std::vector<fs::path> vImportFiles)
} // End scope of CImportingNow
if (gArgs.GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
LoadMempool();
- fDumpMempoolLater = !fRequestShutdown;
}
+ g_is_mempool_loaded = !fRequestShutdown;
}
/** Sanity checks