aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorAmiti Uttarwar <amiti@uttarwar.org>2021-05-28 13:30:35 -0700
committerAmiti Uttarwar <amiti@uttarwar.org>2021-07-30 11:15:49 -0700
commit6f6b7df6bdcf863af160c0426e3a22028ca8259a (patch)
treeb37422b9a29a290aa5acce6ecb16f353fc32e827 /src/init.cpp
parent26d0ffe4f2573e0297c9b0e095c2a0868929b08b (diff)
downloadbitcoin-6f6b7df6bdcf863af160c0426e3a22028ca8259a.tar.xz
[init] Disallow starting up with conflicting paramters for -dnsseed and -forcednsseed
-dnsseed determines whether we run ThreadDNSAddressSeed and potentially query the DNS seeds for addresses. -forcednsseed tells the node to force querying the DNS seeds even if we have sufficient addresses or current connections. This commit disallows starting up with explicitly conflicting parameters.
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 593128747e..11a87dd441 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -853,6 +853,11 @@ bool AppInitParameterInteraction(const ArgsManager& args)
return InitError(_("Prune mode is incompatible with -coinstatsindex."));
}
+ // If -forcednsseed is set to true, ensure -dnsseed has not been set to false
+ if (args.GetBoolArg("-forcednsseed", DEFAULT_FORCEDNSSEED) && !args.GetBoolArg("-dnsseed", DEFAULT_DNSSEED)){
+ return InitError(_("Cannot set -forcednsseed to true when setting -dnsseed to false."));
+ }
+
// -bind and -whitebind can't be set when not listening
size_t nUserBind = args.GetArgs("-bind").size() + args.GetArgs("-whitebind").size();
if (nUserBind != 0 && !args.GetBoolArg("-listen", DEFAULT_LISTEN)) {