aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2015-10-28 02:24:44 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2015-10-28 02:25:06 +0100
commite06c14fb59ee493da5283819420d949a14304ca7 (patch)
tree2d1b41bd1895a3e59001f44b6eda249bdf5c2712 /src/init.cpp
parent8756c986420ccd8302c396e0db8f5434dd41c57a (diff)
parentab1f56072a796b0ff039d6690c6ac929dbcbf243 (diff)
Merge pull request #6776
ab1f560 Support -checkmempool=N, which runs checks on average once every N transactions (Pieter Wuille)
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 920fc3069e..4189907b9f 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -841,7 +841,10 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
InitWarning(_("Warning: Unsupported argument -benchmark ignored, use -debug=bench."));
// Checkmempool and checkblockindex default to true in regtest mode
- mempool.setSanityCheck(GetBoolArg("-checkmempool", chainparams.DefaultConsistencyChecks()));
+ int ratio = std::min<int>(std::max<int>(GetArg("-checkmempool", chainparams.DefaultConsistencyChecks() ? 1 : 0), 0), 1000000);
+ if (ratio != 0) {
+ mempool.setSanityCheck(1.0 / ratio);
+ }
fCheckBlockIndex = GetBoolArg("-checkblockindex", chainparams.DefaultConsistencyChecks());
fCheckpointsEnabled = GetBoolArg("-checkpoints", true);