mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Merge bitcoin/bitcoin#20769: net: fixes #20657 - Advertised address where nobody is listening
a38137479bnet: do not advertise address where nobody is listening (Jadi) Pull request description: 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. ACKs for top commit: vasild: ACKa38137479bjarolrod: ACKa38137479bamitiuttarwar: ACKa38137479bTree-SHA512: e84a0a9a51f2217edf35d06c6cd9085d1e664452655ba92027195a1e88ba081d157310c84e9709a99ce5d46c94f231477ca2d36f010648b0c8b4f2a737d54e5d
This commit is contained in:
@@ -860,6 +860,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);
|
||||
|
||||
Reference in New Issue
Block a user