mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-28 04:52:36 +02:00
net: do not advertise address where nobody is listening
If the bitcoind starts when listen=0 but listenonion=1, the daemon will advertise its onion address but nothing is listening for it. This update will enforce listenonion=0 when the listen is 0. fixes #20657
This commit is contained in:
parent
01bb3afb51
commit
a38137479b
@ -1047,6 +1047,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);
|
||||
|
Loading…
Reference in New Issue
Block a user