Skip to content

Commit f8a8e27

Browse files
committed
Merge pull request #7069
fa472f3 [trivial] Fix -maxmempool InitError (MarcoFalke)
2 parents be281d8 + fa472f3 commit f8a8e27

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/init.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -879,11 +879,11 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
879879
fCheckBlockIndex = GetBoolArg("-checkblockindex", chainparams.DefaultConsistencyChecks());
880880
fCheckpointsEnabled = GetBoolArg("-checkpoints", true);
881881

882-
// -mempoollimit limits
883-
int64_t nMempoolSizeLimit = GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000;
884-
int64_t nMempoolDescendantSizeLimit = GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) * 1000;
885-
if (nMempoolSizeLimit < 0 || nMempoolSizeLimit < nMempoolDescendantSizeLimit * 40)
886-
return InitError(strprintf(_("-maxmempool must be at least %d MB"), GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) / 25));
882+
// mempool limits
883+
int64_t nMempoolSizeMax = GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000;
884+
int64_t nMempoolSizeMin = GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) * 1000 * 40;
885+
if (nMempoolSizeMax < 0 || nMempoolSizeMax < nMempoolSizeMin)
886+
return InitError(strprintf(_("-maxmempool must be at least %d MB"), std::ceil(nMempoolSizeMin / 1000.0)));
887887

888888
// -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency
889889
nScriptCheckThreads = GetArg("-par", DEFAULT_SCRIPTCHECK_THREADS);

0 commit comments

Comments
 (0)