diff options
| author | Wladimir J. van der Laan <[email protected]> | 2015-11-26 11:18:26 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2015-11-26 11:18:31 +0100 |
| commit | f8a8e27a6a1901152822d59622f9aeb25a78a78d (patch) | |
| tree | e594c4637752df8d8d80c726c96bc8e55e14dd1e /src/init.cpp | |
| parent | Merge pull request #7087 (diff) | |
| parent | [trivial] Fix -maxmempool InitError (diff) | |
| download | discoin-f8a8e27a6a1901152822d59622f9aeb25a78a78d.tar.xz discoin-f8a8e27a6a1901152822d59622f9aeb25a78a78d.zip | |
Merge pull request #7069
fa472f3 [trivial] Fix -maxmempool InitError (MarcoFalke)
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/init.cpp b/src/init.cpp index 721ae225c..953980c5b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -879,11 +879,11 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) fCheckBlockIndex = GetBoolArg("-checkblockindex", chainparams.DefaultConsistencyChecks()); fCheckpointsEnabled = GetBoolArg("-checkpoints", true); - // -mempoollimit limits - int64_t nMempoolSizeLimit = GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; - int64_t nMempoolDescendantSizeLimit = GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) * 1000; - if (nMempoolSizeLimit < 0 || nMempoolSizeLimit < nMempoolDescendantSizeLimit * 40) - return InitError(strprintf(_("-maxmempool must be at least %d MB"), GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) / 25)); + // mempool limits + int64_t nMempoolSizeMax = GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; + int64_t nMempoolSizeMin = GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) * 1000 * 40; + if (nMempoolSizeMax < 0 || nMempoolSizeMax < nMempoolSizeMin) + return InitError(strprintf(_("-maxmempool must be at least %d MB"), std::ceil(nMempoolSizeMin / 1000.0))); // -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency nScriptCheckThreads = GetArg("-par", DEFAULT_SCRIPTCHECK_THREADS); |