diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2020-12-09 05:24:09 +0100 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2021-03-01 18:19:46 +0100 |
commit | 9559bd1404fbf74b0d09fe9019a9305cb4e151ce (patch) | |
tree | d5de9c3363139433094e1f2cf4d4230bb1c2bdbf /src/netaddress.cpp | |
parent | 76c35c60f338937071bcfad4211ef7254d3830ec (diff) |
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.
Diffstat (limited to 'src/netaddress.cpp')
-rw-r--r-- | src/netaddress.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/netaddress.cpp b/src/netaddress.cpp index 80313b88ce..69edc15c66 100644 --- a/src/netaddress.cpp +++ b/src/netaddress.cpp @@ -878,6 +878,11 @@ int CNetAddr::GetReachabilityFrom(const CNetAddr *paddrPartner) const case NET_IPV4: return REACH_IPV4; // Tor users can connect to IPv4 as well case NET_ONION: return REACH_PRIVATE; } + case NET_I2P: + switch (ourNet) { + case NET_I2P: return REACH_PRIVATE; + default: return REACH_DEFAULT; + } case NET_TEREDO: switch(ourNet) { default: return REACH_DEFAULT; |