mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-07 19:48:58 +02:00
mempool: Don't share mempool with dbcache in blocksonly
When -blockonly is set, reduce mempool size to 5MB unless -maxmempool is also set. See #9569
This commit is contained in:
parent
8339f3cea8
commit
1134686ef9
@ -719,10 +719,13 @@ void InitParameterInteraction(ArgsManager& args)
|
||||
LogPrintf("%s: parameter interaction: -externalip set -> setting -discover=0\n", __func__);
|
||||
}
|
||||
|
||||
// disable whitelistrelay in blocksonly mode
|
||||
if (args.GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY)) {
|
||||
// disable whitelistrelay in blocksonly mode
|
||||
if (args.SoftSetBoolArg("-whitelistrelay", false))
|
||||
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -whitelistrelay=0\n", __func__);
|
||||
// Reduce default mempool size in blocksonly mode to avoid unexpected resource usage
|
||||
if (args.SoftSetArg("-maxmempool", ToString(DEFAULT_BLOCKSONLY_MAX_MEMPOOL_SIZE_MB)))
|
||||
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -maxmempool=%d\n", __func__, DEFAULT_BLOCKSONLY_MAX_MEMPOOL_SIZE_MB);
|
||||
}
|
||||
|
||||
// Forcing relay from whitelisted hosts implies we will accept relays from them in the first place.
|
||||
|
@ -18,6 +18,8 @@ class CBlockPolicyEstimator;
|
||||
|
||||
/** Default for -maxmempool, maximum megabytes of mempool memory usage */
|
||||
static constexpr unsigned int DEFAULT_MAX_MEMPOOL_SIZE_MB{300};
|
||||
//** Default for -maxmempool when blocksonly is set */
|
||||
static constexpr unsigned int DEFAULT_BLOCKSONLY_MAX_MEMPOOL_SIZE_MB{5};
|
||||
/** Default for -mempoolexpiry, expiration time for mempool transactions in hours */
|
||||
static constexpr unsigned int DEFAULT_MEMPOOL_EXPIRY_HOURS{336};
|
||||
/** Default for -mempoolfullrbf, if the transaction replaceability signaling is ignored */
|
||||
|
Loading…
x
Reference in New Issue
Block a user