From 77f5dd2d14cb292218b2512d624d238c64e6393b Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Wed, 12 Nov 2008 22:46:07 +0000
Subject: [PATCH] Fix blocklists with hashes only

---
 router/java/src/net/i2p/router/Blocklist.java | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/router/java/src/net/i2p/router/Blocklist.java b/router/java/src/net/i2p/router/Blocklist.java
index 02d5d116a4..2d8da6c529 100644
--- a/router/java/src/net/i2p/router/Blocklist.java
+++ b/router/java/src/net/i2p/router/Blocklist.java
@@ -115,6 +115,16 @@ public class Blocklist {
                     return;
                 }
             }
+            for (Iterator iter = _peerBlocklist.keySet().iterator(); iter.hasNext(); ) {
+                Hash peer = (Hash) iter.next();
+                String reason = "Blocklisted by router hash";
+                String comment = (String) _peerBlocklist.get(peer);
+                if (comment != null)
+                    reason = reason + ": " + comment;
+                _context.shitlist().shitlistRouterForever(peer, reason);
+            }
+            _peerBlocklist = null;
+
             if (_blocklistSize <= 0)
                 return;
             FloodfillNetworkDatabaseFacade fndf = (FloodfillNetworkDatabaseFacade) _context.netDb();
@@ -127,15 +137,6 @@ public class Blocklist {
             }
             if (count > 0 && _log.shouldLog(Log.WARN))
                 _log.warn("Blocklisted " + count + " routers in the netDb.");
-            for (Iterator iter = _peerBlocklist.keySet().iterator(); iter.hasNext(); ) {
-                Hash peer = (Hash) iter.next();
-                String reason = "Blocklisted by router hash";
-                String comment = (String) _peerBlocklist.get(peer);
-                if (comment != null)
-                    reason = reason + ": " + comment;
-                _context.shitlist().shitlistRouterForever(peer, reason);
-            }
-            _peerBlocklist = null;
         }
     }
 
-- 
GitLab