aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorVasil Dimov <vd@FreeBSD.org>2020-10-19 15:32:54 +0200
committerVasil Dimov <vd@FreeBSD.org>2022-03-02 15:42:40 +0100
commit7d64ea4a01920bb55bc6de0de6766712ec792a11 (patch)
tree75722477417ad2a8c3600dd8634d57befcdce58a /src/net.h
parent0cfc0cd32239d3c08d2121e028b297022450b320 (diff)
downloadbitcoin-7d64ea4a01920bb55bc6de0de6766712ec792a11.tar.xz
net: only assume all local addresses if listening on any
If `-bind=` is provided then we would bind only to a particular address and should not add all the other addresses of the machine to the list of local addresses. Fixes https://github.com/bitcoin/bitcoin/issues/20184 (case 4.)
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index ddc1d3dd7c..a38310938b 100644
--- a/src/net.h
+++ b/src/net.h
@@ -183,7 +183,15 @@ enum class ConnectionType {
/** Convert ConnectionType enum to a string value */
std::string ConnectionTypeAsString(ConnectionType conn_type);
+
+/**
+ * Look up IP addresses from all interfaces on the machine and add them to the
+ * list of local addresses to self-advertise.
+ * The loopback interface is skipped and only the first address from each
+ * interface is used.
+ */
void Discover();
+
uint16_t GetListenPort();
enum