mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
Merge bitcoin/bitcoin#20769: net: fixes #20657 - Advertised address where nobody is listening
a38137479b
net: 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: ACKa38137479b
jarolrod: ACKa38137479b
amitiuttarwar: ACKa38137479b
Tree-SHA512: e84a0a9a51f2217edf35d06c6cd9085d1e664452655ba92027195a1e88ba081d157310c84e9709a99ce5d46c94f231477ca2d36f010648b0c8b4f2a737d54e5d
This commit is contained in:
commit
58b559fab0
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue