forked from I2P_Developers/i2p.i2p
use new getVersion()
This commit is contained in:
@@ -214,9 +214,8 @@ public class DatabaseLookupMessage extends FastI2NPMessageImpl {
|
||||
public static boolean supportsEncryptedReplies(RouterInfo to) {
|
||||
if (to == null)
|
||||
return false;
|
||||
String v = to.getOption("router.version");
|
||||
return v != null &&
|
||||
VersionComparator.comp(v, MIN_ENCRYPTION_VERSION) >= 0;
|
||||
String v = to.getVersion();
|
||||
return VersionComparator.comp(v, MIN_ENCRYPTION_VERSION) >= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -513,9 +513,7 @@ class StoreJob extends JobImpl {
|
||||
* @since 0.7.10
|
||||
*/
|
||||
private static boolean supportsEncryption(RouterInfo ri) {
|
||||
String v = ri.getOption("router.version");
|
||||
if (v == null)
|
||||
return false;
|
||||
String v = ri.getVersion();
|
||||
return VersionComparator.comp(v, MIN_ENCRYPTION_VERSION) >= 0;
|
||||
}
|
||||
|
||||
@@ -535,9 +533,7 @@ class StoreJob extends JobImpl {
|
||||
}
|
||||
if (type == null)
|
||||
return false;
|
||||
String v = ri.getOption("router.version");
|
||||
if (v == null)
|
||||
return false;
|
||||
String v = ri.getVersion();
|
||||
String since = type.getSupportedSince();
|
||||
return VersionComparator.comp(v, since) >= 0;
|
||||
}
|
||||
@@ -549,9 +545,7 @@ class StoreJob extends JobImpl {
|
||||
* @since 0.9.12
|
||||
*/
|
||||
public static boolean supportsBigLeaseSets(RouterInfo ri) {
|
||||
String v = ri.getOption("router.version");
|
||||
if (v == null)
|
||||
return false;
|
||||
String v = ri.getVersion();
|
||||
return VersionComparator.comp(v, MIN_BIGLEASESET_VERSION) >= 0;
|
||||
}
|
||||
|
||||
|
@@ -697,9 +697,9 @@ public class ProfileOrganizer {
|
||||
// they probably don't have a TCP hole punched in their firewall either.
|
||||
RouterInfo info = _context.netDb().lookupRouterInfoLocally(peer);
|
||||
if (info != null) {
|
||||
String v = info.getOption("router.version");
|
||||
String v = info.getVersion();
|
||||
// this only works if there is no 0.6.1.34!
|
||||
if (v != null && (!v.equals("0.6.1.33")) &&
|
||||
if ((!v.equals("0.6.1.33")) &&
|
||||
v.startsWith("0.6.1.") && info.getTargetAddress("NTCP") == null)
|
||||
l.add(peer);
|
||||
else {
|
||||
|
@@ -375,8 +375,8 @@ public class NTCPTransport extends TransportImpl {
|
||||
if (us != null) {
|
||||
RouterIdentity id = us.getIdentity();
|
||||
if (id.getSigType() != SigType.DSA_SHA1) {
|
||||
String v = toAddress.getOption("router.version");
|
||||
if (v != null && VersionComparator.comp(v, MIN_SIGTYPE_VERSION) < 0) {
|
||||
String v = toAddress.getVersion();
|
||||
if (VersionComparator.comp(v, MIN_SIGTYPE_VERSION) < 0) {
|
||||
markUnreachable(peer);
|
||||
return null;
|
||||
}
|
||||
|
@@ -1232,7 +1232,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
_context.simpleScheduler().addEvent(new RemoveDropList(remote), DROPLIST_PERIOD);
|
||||
}
|
||||
markUnreachable(peerHash);
|
||||
_context.banlist().banlistRouter(peerHash, "Part of the wrong network, version = " + ((RouterInfo) entry).getOption("router.version"));
|
||||
_context.banlist().banlistRouter(peerHash, "Part of the wrong network, version = " + ((RouterInfo) entry).getVersion());
|
||||
//_context.banlist().banlistRouter(peerHash, "Part of the wrong network", STYLE);
|
||||
dropPeer(peerHash, false, "wrong network");
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
@@ -1578,8 +1578,8 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
if (us != null) {
|
||||
RouterIdentity id = us.getIdentity();
|
||||
if (id.getSigType() != SigType.DSA_SHA1) {
|
||||
String v = toAddress.getOption("router.version");
|
||||
if (v != null && VersionComparator.comp(v, MIN_SIGTYPE_VERSION) < 0) {
|
||||
String v = toAddress.getVersion();
|
||||
if (VersionComparator.comp(v, MIN_SIGTYPE_VERSION) < 0) {
|
||||
markUnreachable(to);
|
||||
return null;
|
||||
}
|
||||
|
@@ -238,9 +238,7 @@ abstract class BuildRequestor {
|
||||
RouterInfo ri = ctx.netDb().lookupRouterInfoLocally(h);
|
||||
if (ri == null)
|
||||
return false;
|
||||
String v = ri.getOption("router.version");
|
||||
if (v == null)
|
||||
return false;
|
||||
String v = ri.getVersion();
|
||||
return VersionComparator.comp(v, MIN_VARIABLE_VERSION) >= 0;
|
||||
}
|
||||
|
||||
|
@@ -349,9 +349,7 @@ public abstract class TunnelPeerSelector {
|
||||
if (known != null) {
|
||||
for (int i = 0; i < known.size(); i++) {
|
||||
RouterInfo peer = known.get(i);
|
||||
String v = peer.getOption("router.version");
|
||||
if (v == null)
|
||||
continue;
|
||||
String v = peer.getVersion();
|
||||
// RI sigtypes added in 0.9.16
|
||||
// SSU inbound connection bug fixed in 0.9.17, but it won't bid, so NTCP only,
|
||||
// no need to check
|
||||
@@ -402,8 +400,8 @@ public abstract class TunnelPeerSelector {
|
||||
// so don't exclude it based on published capacity
|
||||
|
||||
// minimum version check
|
||||
String v = peer.getOption("router.version");
|
||||
if (v == null || VersionComparator.comp(v, MIN_VERSION) < 0)
|
||||
String v = peer.getVersion();
|
||||
if (VersionComparator.comp(v, MIN_VERSION) < 0)
|
||||
return true;
|
||||
|
||||
// uptime is always spoofed to 90m, so just remove all this
|
||||
|
Reference in New Issue
Block a user