Skip to content

Commit 9559bd1

Browse files
committed
net: add I2P to the reachability map
Update `CNetAddr::GetReachabilityFrom()` to recognize the I2P network so that we would prefer to advertise our I2P address to I2P peers.
1 parent 76c35c6 commit 9559bd1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/netaddress.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,11 @@ int CNetAddr::GetReachabilityFrom(const CNetAddr *paddrPartner) const
878878
case NET_IPV4: return REACH_IPV4; // Tor users can connect to IPv4 as well
879879
case NET_ONION: return REACH_PRIVATE;
880880
}
881+
case NET_I2P:
882+
switch (ourNet) {
883+
case NET_I2P: return REACH_PRIVATE;
884+
default: return REACH_DEFAULT;
885+
}
881886
case NET_TEREDO:
882887
switch(ourNet) {
883888
default: return REACH_DEFAULT;

0 commit comments

Comments
 (0)