Blocklist: Don't add IPv4 addresses permanently banned to the transient list

Already hidden on /configpeers, so don't waste the space
This commit is contained in:
zzz
2022-12-23 07:36:22 -05:00
parent 3580430005
commit 31d0bc33d6

View File

@@ -742,6 +742,9 @@ public class Blocklist {
* @return true if it was NOT previously on the list
*/
private boolean add(int ip) {
// save space, don't put in both
if (isPermanentlyBlocklisted(ip))
return false;
Integer iip = Integer.valueOf(ip);
synchronized(_singleIPBlocklist) {
return _singleIPBlocklist.put(iip, DUMMY) == null;
@@ -1193,6 +1196,8 @@ public class Blocklist {
* Single IPs blocked until restart. Unsorted.
*
* Public for console only, not a public API
* As of 0.9.57, will not contain IPs permanently banned,
* except for ones banned permanently after being added to the transient list.
*
* @return a copy, unsorted
* @since 0.9.48