Skip to content

Commit 6f6b7df

Browse files
committed
[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.
1 parent 26d0ffe commit 6f6b7df

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/init.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,11 @@ bool AppInitParameterInteraction(const ArgsManager& args)
853853
return InitError(_("Prune mode is incompatible with -coinstatsindex."));
854854
}
855855

856+
// If -forcednsseed is set to true, ensure -dnsseed has not been set to false
857+
if (args.GetBoolArg("-forcednsseed", DEFAULT_FORCEDNSSEED) && !args.GetBoolArg("-dnsseed", DEFAULT_DNSSEED)){
858+
return InitError(_("Cannot set -forcednsseed to true when setting -dnsseed to false."));
859+
}
860+
856861
// -bind and -whitebind can't be set when not listening
857862
size_t nUserBind = args.GetArgs("-bind").size() + args.GetArgs("-whitebind").size();
858863
if (nUserBind != 0 && !args.GetBoolArg("-listen", DEFAULT_LISTEN)) {

0 commit comments

Comments
 (0)