diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -401,7 +401,7 @@ DEFAULT_MAX_ORPHAN_TRANSACTIONS)); strUsage += HelpMessageOpt("-maxmempool=", strprintf(_("Keep the transaction memory pool " - "below megabytes (default: %u)"), + "below bytes (default: %u)"), DEFAULT_MAX_MEMPOOL_SIZE)); strUsage += HelpMessageOpt("-mempoolexpiry=", @@ -1539,7 +1539,7 @@ // mempool limits int64_t nMempoolSizeMax = - gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; + gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE); int64_t nMempoolSizeMin = gArgs.GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) * 1000 * 40; @@ -2024,7 +2024,7 @@ // the rest goes to in-memory cache nCoinCacheUsage = nTotalCache; int64_t nMempoolSizeMax = - gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; + gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE); LogPrintf("Cache configuration:\n"); LogPrintf("* Using %.1fMiB for block index database\n", nBlockTreeDBCache * (1.0 / 1024 / 1024)); diff --git a/src/policy/policy.h b/src/policy/policy.h --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -54,9 +54,9 @@ */ static const unsigned int MAX_STANDARD_TX_SIGOPS = MAX_TX_SIGOPS_COUNT / 5; /** - * Default for -maxmempool, maximum megabytes of mempool memory usage. + * Default for -maxmempool, maximum bytes of mempool memory usage. */ -static const unsigned int DEFAULT_MAX_MEMPOOL_SIZE = 300; +static const unsigned int DEFAULT_MAX_MEMPOOL_SIZE = 300000000; /** * Default for -incrementalrelayfee, which sets the minimum feerate increase for * mempool limiting or BIP 125 replacement. diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1442,8 +1442,7 @@ ret.pushKV("size", (int64_t)g_mempool.size()); ret.pushKV("bytes", (int64_t)g_mempool.GetTotalTxSize()); ret.pushKV("usage", (int64_t)g_mempool.DynamicMemoryUsage()); - size_t maxmempool = - gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; + size_t maxmempool = gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE); ret.pushKV("maxmempool", (int64_t)maxmempool); ret.pushKV("mempoolminfee", ValueFromAmount(g_mempool.GetMinFee(maxmempool).GetFeePerK())); diff --git a/src/txmempool.cpp b/src/txmempool.cpp --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -954,7 +954,7 @@ LOCK(cs); uint64_t maxMempoolSize = - gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; + gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE); // minerPolicy uses recent blocks to figure out a reasonable fee. This // may disagree with the rollingMinimumFeerate under certain scenarios // where the mempool increases rapidly, or blocks are being mined which @@ -1389,7 +1389,7 @@ STANDARD_LOCKTIME_VERIFY_FLAGS); // Re-limit mempool size, in case we added any transactions - g_mempool.LimitSize( - gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000, - gArgs.GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * 60 * 60); + g_mempool.LimitSize(gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE), + gArgs.GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * + 60 * 60); } diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -554,8 +554,7 @@ CFeeRate minRelayTxFee = config.GetMinFeePerKB(); Amount mempoolRejectFee = pool.GetMinFee( - gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * - 1000000) + gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE)) .GetFee(nSize); if (mempoolRejectFee > Amount::zero() && nModifiedFees < mempoolRejectFee) { @@ -725,7 +724,7 @@ // Trim mempool and check if tx was trimmed. if (!fOverrideMempoolLimit) { pool.LimitSize( - gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000, + gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE), gArgs.GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * 60 * 60); if (!pool.exists(txid)) { @@ -2004,7 +2003,7 @@ nLastSetChain = nNow; } int64_t nMempoolSizeMax = - gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; + gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE); int64_t cacheSize = pcoinsTip->DynamicMemoryUsage(); int64_t nTotalSpace = nCoinCacheUsage +