aboutsummaryrefslogtreecommitdiff
path: root/src/netaddress.h
diff options
context:
space:
mode:
authorVasil Dimov <vd@FreeBSD.org>2021-05-31 17:18:49 +0200
committerVasil Dimov <vd@FreeBSD.org>2021-07-09 11:19:35 +0200
commit38f900290cc3a839e99bef13474d35e1c02e6b0d (patch)
treea2b675570fd8095ebbd14876c3297626a80e1354 /src/netaddress.h
parentefff9c3494a944a1a9288fec13e8bb5f23235920 (diff)
net: change assumed I2P port to 0
* When accepting an I2P connection, assume the peer has port 0 instead of the default 8333 (for mainnet). It is not being sent to us, so we must assume something. * When deriving our own I2P listen CService use port 0 instead of the default 8333 (for mainnet). So that we later advertise it to peers with port 0. In the I2P protocol SAM 3.1 and older (we use 3.1) ports are not used, so they are irrelevant. However in SAM 3.2 and newer ports are used and from the point of view of SAM 3.2, a peer using SAM 3.1 seems to have specified port=0.
Diffstat (limited to 'src/netaddress.h')
-rw-r--r--src/netaddress.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/netaddress.h b/src/netaddress.h
index dd47ab5749..d504996347 100644
--- a/src/netaddress.h
+++ b/src/netaddress.h
@@ -112,6 +112,9 @@ static constexpr size_t ADDR_CJDNS_SIZE = 16;
/// Size of "internal" (NET_INTERNAL) address (in bytes).
static constexpr size_t ADDR_INTERNAL_SIZE = 10;
+/// SAM 3.1 and earlier do not support specifying ports and force the port to 0.
+static constexpr uint16_t I2P_SAM31_PORT{0};
+
/**
* Network address.
*/