I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit eb0c8aaa authored by idk's avatar idk
Browse files

correct the error in the previous checkin

parent e55e6bc7
No related branches found
No related merge requests found
......@@ -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();
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment