aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-08-23 09:01:05 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-08-23 09:01:08 +0200
commit58b559fab025f50fee991532426a9a6a8db3e88d (patch)
tree07daf202fb6992afe4a207fe55536a1769e38db5 /src
parente826b22da252e0599c61d21c98ff89f366b3120f (diff)
parenta38137479bf5e25bf65a62e46b81fc43fb3df75c (diff)
Merge bitcoin/bitcoin#20769: net: fixes #20657 - Advertised address where nobody is listening
a38137479bf5e25bf65a62e46b81fc43fb3df75c 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: ACK a38137479bf5e25bf65a62e46b81fc43fb3df75c jarolrod: ACK a38137479bf5e25bf65a62e46b81fc43fb3df75c amitiuttarwar: ACK a38137479bf5e25bf65a62e46b81fc43fb3df75c Tree-SHA512: e84a0a9a51f2217edf35d06c6cd9085d1e664452655ba92027195a1e88ba081d157310c84e9709a99ce5d46c94f231477ca2d36f010648b0c8b4f2a737d54e5d
Diffstat (limited to 'src')
-rw-r--r--src/init.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp
index d741badc92..bf027b2879 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -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);