Skip to content

Commit cb9bd83

Browse files
committed
Add DefaultCheckMemPool chain parameter
1 parent 2595b9a commit cb9bd83

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/chainparams.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ class CRegTestParams : public CTestNetParams {
250250
virtual bool RequireRPCPassword() const { return false; }
251251
virtual bool MiningRequiresPeers() const { return false; }
252252
virtual bool MineBlocksOnDemand() const { return true; }
253+
virtual bool DefaultCheckMemPool() const { return true; }
253254
virtual Network NetworkID() const { return CChainParams::REGTEST; }
254255
};
255256
static CRegTestParams regTestParams;

src/chainparams.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ class CChainParams
6363
virtual bool RequireRPCPassword() const { return true; }
6464
/* Make miner wait to have peers to avoid wasting work */
6565
virtual bool MiningRequiresPeers() const { return true; }
66+
/* Default value for -checkmempool argument */
67+
virtual bool DefaultCheckMemPool() const { return false; }
6668
const string& DataDir() const { return strDataDir; }
6769
/* Make miner stop after a block is found. In RPC, don't return
6870
* until nGenProcLimit blocks are generated */

src/init.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,8 @@ bool AppInit2(boost::thread_group& threadGroup)
517517
InitWarning(_("Warning: Deprecated argument -debugnet ignored, use -debug=net"));
518518

519519
fBenchmark = GetBoolArg("-benchmark", false);
520-
mempool.setSanityCheck(GetBoolArg("-checkmempool", RegTest()));
520+
// Checkmempool defaults to true in regtest mode
521+
mempool.setSanityCheck(GetBoolArg("-checkmempool", Params().DefaultCheckMemPool()));
521522
Checkpoints::fEnabled = GetBoolArg("-checkpoints", true);
522523

523524
// -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency

0 commit comments

Comments
 (0)