@@ -930,11 +930,6 @@ bool AppInitParameterInteraction(const ArgsManager& args, bool use_syscall_sandb
930
930
LogPrintf (" Warning: nMinimumChainWork set below default value of %s\n " , chainparams.GetConsensus ().nMinimumChainWork .GetHex ());
931
931
}
932
932
933
- // mempool limits
934
- int64_t nMempoolSizeMax = args.GetIntArg (" -maxmempool" , DEFAULT_MAX_MEMPOOL_SIZE_MB) * 1000000 ;
935
- int64_t nMempoolSizeMin = args.GetIntArg (" -limitdescendantsize" , DEFAULT_DESCENDANT_SIZE_LIMIT_KVB) * 1000 * 40 ;
936
- if (nMempoolSizeMax < 0 || nMempoolSizeMax < nMempoolSizeMin)
937
- return InitError (strprintf (_ (" -maxmempool must be at least %d MB" ), std::ceil (nMempoolSizeMin / 1000000.0 )));
938
933
// incremental relay fee sets the minimum feerate increase necessary for BIP 125 replacement in the mempool
939
934
// and the amount the mempool min fee increases above the feerate of txs evicted due to mempool limiting.
940
935
if (args.IsArgSet (" -incrementalrelayfee" )) {
@@ -1433,6 +1428,11 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
1433
1428
};
1434
1429
ApplyArgsManOptions (args, mempool_opts);
1435
1430
mempool_opts.check_ratio = std::clamp<int >(mempool_opts.check_ratio , 0 , 1'000'000 );
1431
+
1432
+ int64_t descendant_limit_bytes = mempool_opts.limits .descendant_size_vbytes * 40 ;
1433
+ if (mempool_opts.max_size_bytes < 0 || mempool_opts.max_size_bytes < descendant_limit_bytes) {
1434
+ return InitError (strprintf (_ (" -maxmempool must be at least %d MB" ), std::ceil (descendant_limit_bytes / 1'000'000.0 )));
1435
+ }
1436
1436
LogPrintf (" * Using %.1f MiB for in-memory UTXO set (plus up to %.1f MiB of unused mempool space)\n " , cache_sizes.coins * (1.0 / 1024 / 1024 ), mempool_opts.max_size_bytes * (1.0 / 1024 / 1024 ));
1437
1437
1438
1438
for (bool fLoaded = false ; !fLoaded && !ShutdownRequested ();) {
0 commit comments