aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorwillcl-ark <will@256k1.dev>2022-11-08 13:52:49 +0000
committerwillcl-ark <will@256k1.dev>2023-01-20 12:53:13 +0000
commit1134686ef92fb622ac32dc7463d3763cf18c85ad (patch)
tree54138415b447d4ee4187cc57240aba0e43a307d9 /src/init.cpp
parent8339f3cea841005066239fa43e16586fdfd9d19a (diff)
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
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 5160718eaa..b2b0308353 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -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.