forked from I2P_Developers/i2p.i2p
correct the error in the previous checkin
This commit is contained in:
@ -147,7 +147,7 @@ public class Blocklist {
|
||||
_blocklistFeedFile = new File(BLOCKLIST_FEED_FILE);
|
||||
_haveIPv6 = TransportUtil.getIPv6Config(_context, "SSU") != TransportUtil.IPv6Config.IPV6_DISABLED &&
|
||||
Addresses.isConnectedIPv6();
|
||||
Blocklist = _haveIPv6 ? new LHMCache<BigInteger, Object>(MAX_IPV6_SINGLES) : null;
|
||||
_singleIPv6Blocklist = _haveIPv6 ? new LHMCache<BigInteger, Object>(MAX_IPV6_SINGLES) : null;
|
||||
}
|
||||
|
||||
|
||||
@ -896,10 +896,12 @@ public class Blocklist {
|
||||
* @since IPv6
|
||||
*/
|
||||
private boolean add(BigInteger ip) {
|
||||
synchronized(_singleIPv6Blocklist) {
|
||||
if (_singleIPv6Blocklist != null)
|
||||
if (_singleIPv6Blocklist != null) {
|
||||
synchronized(_singleIPv6Blocklist) {
|
||||
return _singleIPv6Blocklist.put(ip, DUMMY) == null;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -907,9 +909,10 @@ public class Blocklist {
|
||||
* @since 0.9.28
|
||||
*/
|
||||
private void remove(BigInteger ip) {
|
||||
synchronized(_singleIPv6Blocklist) {
|
||||
if (_singleIPv6Blocklist != null)
|
||||
if (_singleIPv6Blocklist != null) {
|
||||
synchronized(_singleIPv6Blocklist) {
|
||||
_singleIPv6Blocklist.remove(ip);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -918,10 +921,12 @@ public class Blocklist {
|
||||
* @since IPv6
|
||||
*/
|
||||
private boolean isOnSingleList(BigInteger ip) {
|
||||
synchronized(_singleIPv6Blocklist) {
|
||||
if (_singleIPv6Blocklist != null)
|
||||
if (_singleIPv6Blocklist != null) {
|
||||
synchronized(_singleIPv6Blocklist) {
|
||||
return _singleIPv6Blocklist.get(ip) != null;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1365,10 +1370,12 @@ public class Blocklist {
|
||||
public List<BigInteger> getTransientIPv6Blocks() {
|
||||
if (!_haveIPv6)
|
||||
return Collections.<BigInteger>emptyList();
|
||||
synchronized(_singleIPv6Blocklist) {
|
||||
if (_singleIPv6Blocklist != null)
|
||||
return new ArrayList<BigInteger>(_singleIPv6Blocklist.keySet());
|
||||
if (_singleIPv6Blocklist != null) {
|
||||
synchronized(_singleIPv6Blocklist) {
|
||||
return new ArrayList<BigInteger>(_singleIPv6Blocklist.keySet());
|
||||
}
|
||||
}
|
||||
return Collections.<BigInteger>emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user