File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -719,10 +719,13 @@ void InitParameterInteraction(ArgsManager& args)
719719 LogPrintf (" %s: parameter interaction: -externalip set -> setting -discover=0\n " , __func__);
720720 }
721721
722- // disable whitelistrelay in blocksonly mode
723722 if (args.GetBoolArg (" -blocksonly" , DEFAULT_BLOCKSONLY)) {
723+ // disable whitelistrelay in blocksonly mode
724724 if (args.SoftSetBoolArg (" -whitelistrelay" , false ))
725725 LogPrintf (" %s: parameter interaction: -blocksonly=1 -> setting -whitelistrelay=0\n " , __func__);
726+ // Reduce default mempool size in blocksonly mode to avoid unexpected resource usage
727+ if (args.SoftSetArg (" -maxmempool" , ToString (DEFAULT_BLOCKSONLY_MAX_MEMPOOL_SIZE_MB)))
728+ LogPrintf (" %s: parameter interaction: -blocksonly=1 -> setting -maxmempool=%d\n " , __func__, DEFAULT_BLOCKSONLY_MAX_MEMPOOL_SIZE_MB);
726729 }
727730
728731 // Forcing relay from whitelisted hosts implies we will accept relays from them in the first place.
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ class CBlockPolicyEstimator;
1818
1919/* * Default for -maxmempool, maximum megabytes of mempool memory usage */
2020static constexpr unsigned int DEFAULT_MAX_MEMPOOL_SIZE_MB{300 };
21+ // ** Default for -maxmempool when blocksonly is set */
22+ static constexpr unsigned int DEFAULT_BLOCKSONLY_MAX_MEMPOOL_SIZE_MB{5 };
2123/* * Default for -mempoolexpiry, expiration time for mempool transactions in hours */
2224static constexpr unsigned int DEFAULT_MEMPOOL_EXPIRY_HOURS{336 };
2325/* * Default for -mempoolfullrbf, if the transaction replaceability signaling is ignored */
You can’t perform that action at this time.
0 commit comments