mirror of
https://github.com/i2p/i2p.i2p.git
synced 2024-12-06 19:27:00 +01:00
Change calls from Addresses.getIP() to Addresses.getIPOnly() for peer IPs
getIPOnly() is more efficient for pure IP addresses (no hostnames)
This commit is contained in:
@@ -666,7 +666,7 @@ public class Blocklist {
|
||||
* @param ip IPv4 or IPv6
|
||||
*/
|
||||
public void add(String ip) {
|
||||
byte[] pib = Addresses.getIP(ip);
|
||||
byte[] pib = Addresses.getIPOnly(ip);
|
||||
if (pib == null) return;
|
||||
add(pib, null);
|
||||
}
|
||||
@@ -681,7 +681,7 @@ public class Blocklist {
|
||||
* @since 0.9.57
|
||||
*/
|
||||
public void add(String ip, String source) {
|
||||
byte[] pib = Addresses.getIP(ip);
|
||||
byte[] pib = Addresses.getIPOnly(ip);
|
||||
if (pib == null) return;
|
||||
add(pib, source);
|
||||
}
|
||||
@@ -876,7 +876,7 @@ public class Blocklist {
|
||||
* @param ip IPv4 or IPv6
|
||||
*/
|
||||
public boolean isBlocklisted(String ip) {
|
||||
byte[] pib = Addresses.getIP(ip);
|
||||
byte[] pib = Addresses.getIPOnly(ip);
|
||||
if (pib == null) return false;
|
||||
return isBlocklisted(pib);
|
||||
}
|
||||
|
||||
@@ -559,7 +559,7 @@ public class Analysis extends JobImpl implements RouterApp {
|
||||
String last = _context.getProperty("i2np.lastIP");
|
||||
if (last == null)
|
||||
return;
|
||||
ourIP = Addresses.getIP(last);
|
||||
ourIP = Addresses.getIPOnly(last);
|
||||
if (ourIP == null)
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -770,7 +770,7 @@ public class GeoIP {
|
||||
* @param ip IPv4 or IPv6
|
||||
*/
|
||||
public void add(String ip) {
|
||||
byte[] pib = Addresses.getIP(ip);
|
||||
byte[] pib = Addresses.getIPOnly(ip);
|
||||
if (pib == null) return;
|
||||
add(pib);
|
||||
}
|
||||
@@ -812,7 +812,7 @@ public class GeoIP {
|
||||
* @return lower-case code, generally two letters, or null.
|
||||
*/
|
||||
public String get(String ip) {
|
||||
byte[] pib = Addresses.getIP(ip);
|
||||
byte[] pib = Addresses.getIPOnly(ip);
|
||||
if (pib == null) return null;
|
||||
return get(pib);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user