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)
719
719
LogPrintf (" %s: parameter interaction: -externalip set -> setting -discover=0\n " , __func__);
720
720
}
721
721
722
- // disable whitelistrelay in blocksonly mode
723
722
if (args.GetBoolArg (" -blocksonly" , DEFAULT_BLOCKSONLY)) {
723
+ // disable whitelistrelay in blocksonly mode
724
724
if (args.SoftSetBoolArg (" -whitelistrelay" , false ))
725
725
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);
726
729
}
727
730
728
731
// 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;
18
18
19
19
/* * Default for -maxmempool, maximum megabytes of mempool memory usage */
20
20
static 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 };
21
23
/* * Default for -mempoolexpiry, expiration time for mempool transactions in hours */
22
24
static constexpr unsigned int DEFAULT_MEMPOOL_EXPIRY_HOURS{336 };
23
25
/* * Default for -mempoolfullrbf, if the transaction replaceability signaling is ignored */
You can’t perform that action at this time.
0 commit comments