mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-12 05:34:57 +01:00
Merge #9966: Control mempool persistence using a command line parameter
a750d77Add tests for mempool persistence (John Newbery)91c91e1Control mempool persistence using a command line parameter. (John Newbery) Tree-SHA512: 157d01cefd1903b8bfc5cbab42a3cc5e9c1094179bf4b64b3d34c0d4d9b976d593755bfea5c41c631cb758e1de17c6c2058c130d487d20560b7c0bafcddfa520
This commit is contained in:
10
src/init.cpp
10
src/init.cpp
@@ -208,8 +208,9 @@ void Shutdown()
|
||||
|
||||
StopTorControl();
|
||||
UnregisterNodeSignals(GetNodeSignals());
|
||||
if (fDumpMempoolLater)
|
||||
if (fDumpMempoolLater && GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
|
||||
DumpMempool();
|
||||
}
|
||||
|
||||
if (fFeeEstimatesInitialized)
|
||||
{
|
||||
@@ -354,6 +355,7 @@ std::string HelpMessage(HelpMessageMode mode)
|
||||
strUsage += HelpMessageOpt("-maxorphantx=<n>", strprintf(_("Keep at most <n> unconnectable transactions in memory (default: %u)"), DEFAULT_MAX_ORPHAN_TRANSACTIONS));
|
||||
strUsage += HelpMessageOpt("-maxmempool=<n>", strprintf(_("Keep the transaction memory pool below <n> megabytes (default: %u)"), DEFAULT_MAX_MEMPOOL_SIZE));
|
||||
strUsage += HelpMessageOpt("-mempoolexpiry=<n>", strprintf(_("Do not keep transactions in the mempool longer than <n> hours (default: %u)"), DEFAULT_MEMPOOL_EXPIRY));
|
||||
strUsage += HelpMessageOpt("-persistmempool", strprintf(_("Whether to save the mempool on shutdown and load on restart (default: %u)"), DEFAULT_PERSIST_MEMPOOL));
|
||||
strUsage += HelpMessageOpt("-blockreconstructionextratxn=<n>", strprintf(_("Extra transactions to keep in memory for compact block reconstructions (default: %u)"), DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN));
|
||||
strUsage += HelpMessageOpt("-par=<n>", strprintf(_("Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)"),
|
||||
-GetNumCores(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS));
|
||||
@@ -679,8 +681,10 @@ void ThreadImport(std::vector<fs::path> vImportFiles)
|
||||
StartShutdown();
|
||||
}
|
||||
} // End scope of CImportingNow
|
||||
LoadMempool();
|
||||
fDumpMempoolLater = !fRequestShutdown;
|
||||
if (GetArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
|
||||
LoadMempool();
|
||||
fDumpMempoolLater = !fRequestShutdown;
|
||||
}
|
||||
}
|
||||
|
||||
/** Sanity checks
|
||||
|
||||
Reference in New Issue
Block a user