merge bitcoin#20769: fixes "advertised address where nobody is listening"

This commit is contained in:
Kittywhiskers Van Gogh 2020-12-26 12:01:25 +03:30
parent f9e123efd6
commit 43a82bdd29
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD

View File

@ -1256,6 +1256,11 @@ bool AppInitParameterInteraction(const ArgsManager& args)
return InitError(Untranslated("Cannot set -bind or -whitebind together with -listen=0"));
}
// if listen=0, then disallow listenonion=1
if (!args.GetBoolArg("-listen", DEFAULT_LISTEN) && args.GetBoolArg("-listenonion", DEFAULT_LISTEN_ONION)) {
return InitError(Untranslated("Cannot set -listen=0 together with -listenonion=1"));
}
// Make sure enough file descriptors are available
int nBind = std::max(nUserBind, size_t(1));
nUserMaxConnections = args.GetArg("-maxconnections", DEFAULT_MAX_PEER_CONNECTIONS);