Skip to content

Commit fa472f3

Browse files
author
MarcoFalke
committed
[trivial] Fix -maxmempool InitError
1 parent c983d6f commit fa472f3

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
@@ -875,11 +875,11 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
875875
fCheckBlockIndex = GetBoolArg("-checkblockindex", chainparams.DefaultConsistencyChecks());
876876
fCheckpointsEnabled = GetBoolArg("-checkpoints", true);
877877

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

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

0 commit comments

Comments
 (0)