-maxmempool is integer so we need to pass std::ceil( $minimum )
[trivial] Fix -maxmempool InitError #7069
pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:MarcoFalke-2015-maxmempoolInitError changing 1 files +5 −5-
MarcoFalke commented at 1:27 PM on November 20, 2015: member
-
jonasschnelli commented at 1:33 PM on November 20, 2015: contributor
Was also stumpling over that issue. utACK.
-
dcousens commented at 4:40 PM on November 20, 2015: contributor
utACK
-
in src/init.cpp:None in cbd46c0655 outdated
878 | @@ -879,7 +879,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) 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)); 883 | + return InitError(strprintf(_("-maxmempool must be at least %d MB"), std::ceil(GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) / 25.0)));
laanwj commented at 10:27 AM on November 24, 2015:I don't like repeating the computation here in a different form. This is bound to give inconsistencies when it is changed later. Can we do
int64_t mempoolSizeLimitMin = nMempoolDescendantSizeLimit * 40; if (nMempoolSizeLimit < nMempoolSizeLimitMin) return InitError(strprintf(_("-maxmempool must be at least %d MB"), std::ceil(mempoolSizeLimitMin / 1000.0)));MarcoFalke force-pushed on Nov 24, 2015in src/init.cpp:None in fa65c353b1 outdated
876 | @@ -877,9 +877,9 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) 877 | 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)); 883 | + int64_t nMempoolDescendantSizeLimit = GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) * 1000 * 40; 884 | + if (nMempoolSizeLimit < 0 || nMempoolSizeLimit < nMempoolDescendantSizeLimit)
laanwj commented at 11:00 AM on November 24, 2015:Can nMempoolDescendantSizeLimit be (usefully) negative? Otherwise it makes little sense to compare against both 0 and that value.
MarcoFalke force-pushed on Nov 24, 2015MarcoFalke force-pushed on Nov 24, 2015[trivial] Fix -maxmempool InitError fa472f330fMarcoFalke force-pushed on Nov 24, 2015in src/init.cpp:None in fa472f330f
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)); 883 | + // mempool limits 884 | + int64_t nMempoolSizeMax = GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; 885 | + int64_t nMempoolSizeMin = GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) * 1000 * 40;
laanwj commented at 10:18 AM on November 26, 2015:Variable name
nMemPoolSizeMinis not entirely correct as this is the minimum for the maximum mempool size, not the minimum mempool size (which would be non-sensical). Anyhow, not important enough to dwell on I guess.laanwj merged this on Nov 26, 2015laanwj closed this on Nov 26, 2015laanwj referenced this in commit f8a8e27a6a on Nov 26, 2015paveljanik commented at 3:30 PM on November 27, 2015: contributorHmm:
master/src pavel$ ./bitcoind - -maxmempool=4 Error: -maxmempool must be at least 4040 MB master/src pavel$and 5 is OK?
/1000000.0instead of1000.0?paveljanik commented at 3:38 PM on November 27, 2015: contributorI'll PR the fix.
MarcoFalke deleted the branch on Nov 28, 2015MarcoFalke locked this on Sep 8, 2021Contributors
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me