Router: Change quick address check for introducers

from ihost0 to itag0, because SSU2 probably won't use ihost
This commit is contained in:
zzz
2022-03-24 17:31:48 -04:00
parent 0560b3221d
commit f4eda0551d
6 changed files with 7 additions and 7 deletions

View File

@@ -229,7 +229,7 @@ class FloodfillMonitorJob extends JobImpl {
if (ra == null)
happy = false;
else {
if (ra.getOption("ihost0") != null)
if (ra.getOption("itag0") != null)
happy = false;
}
}

View File

@@ -1206,7 +1206,7 @@ public abstract class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacad
// Just check all the addresses, faster than getting just the SSU ones
for (RouterAddress ra : routerInfo.getAddresses()) {
// Introducers change often, introducee will ping introducer for 2 hours
if (ra.getOption("ihost0") != null)
if (ra.getOption("itag0") != null)
return "Old peer with SSU Introducers";
}
}

View File

@@ -97,7 +97,7 @@ public class ReseedBundler {
boolean hasIPv4 = false;
boolean dupIP = false;
for (RouterAddress addr : addrs) {
if ("SSU".equals(addr.getTransportStyle()) && addr.getOption("ihost0") != null) {
if ("SSU".equals(addr.getTransportStyle()) && addr.getOption("itag0") != null) {
hasIntro = true;
break;
}

View File

@@ -815,7 +815,7 @@ public class ProfileOrganizer {
continue;
}
// This is the quick way of doing UDPAddress.getIntroducerCount() > 0
if (ra.getOption("ihost0") != null)
if (ra.getOption("itag0") != null)
l.add(peer);
}
}

View File

@@ -319,7 +319,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
// Don't pass IP along if address has introducers
// Right now we publish the direct UDP address, even if publishing introducers,
// we probably shouldn't, see UDPTransport rebuildExternalAddress() TODO
if (udpAddr != null && udpAddr.getOption("ihost0") == null) {
if (udpAddr != null && udpAddr.getOption("itag0") == null) {
ip = udpAddr.getIP();
port = udpAddr.getPort();
}

View File

@@ -2069,7 +2069,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
boolean rv = (externalListenHost == null) || (externalListenPort <= 0);
if (!rv) {
// shortcut to determine if introducers are present
if (addr.getOption("ihost0") != null)
if (addr.getOption("itag0") != null)
rv = true; // status == ok and we don't actually need introducers, so rebuild
}
if (rv) {
@@ -2325,7 +2325,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
RouterAddress addr = addrs.get(i);
//if (getSSUVersion(addr) == 0)
// continue;
if (addr.getOption("ihost0") == null) {
if (addr.getOption("itag0") == null) {
// No introducers
// Skip outbound-only or invalid address/port
byte[] ip = addr.getIP();