mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 06:52:36 +01:00
[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.
This commit is contained in:
parent
26d0ffe4f2
commit
6f6b7df6bd
1 changed files with 5 additions and 0 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue