From 8bc2fd7e42d2ff5b313de1a2c3ebeb7e4eeb0f93 Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Tue, 10 Nov 2009 21:27:01 +0000
Subject: [PATCH] 3rd time...

---
 .../kademlia/FloodfillPeerSelector.java          | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillPeerSelector.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillPeerSelector.java
index a1f80be629..c7cc209c04 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillPeerSelector.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillPeerSelector.java
@@ -129,20 +129,28 @@ class FloodfillPeerSelector extends PeerSelector {
             } else {
                 PeerProfile prof = _context.profileOrganizer().getProfile(entry);
                 if (prof != null && prof.getDBHistory() != null
-                    && now - prof.getDBHistory().getLastStoreFailed() < now - NO_FAIL_STORE_GOOD
-                    && now - prof.getDBHistory().getLastLookupFailed() < now - NO_FAIL_LOOKUP_GOOD) {
+                    && prof.getDBHistory().getLastStoreFailed() < now - NO_FAIL_STORE_GOOD
+                    && prof.getDBHistory().getLastLookupFailed() < now - NO_FAIL_LOOKUP_GOOD) {
                     // good
+                    if (_log.shouldLog(Log.DEBUG))
+                        _log.debug("Good: " + entry);
                     rv.add(entry);
                     found++;
                 } else if (prof != null && prof.getDBHistory() != null
-                           && now - prof.getDBHistory().getLastStoreFailed() < now - NO_FAIL_STORE_OK
-                           && now - prof.getDBHistory().getLastLookupFailed() < now - NO_FAIL_LOOKUP_OK) {
+                           && prof.getDBHistory().getLastStoreFailed() < now - NO_FAIL_STORE_OK
+                           && prof.getDBHistory().getLastLookupFailed() < now - NO_FAIL_LOOKUP_OK) {
+                    if (_log.shouldLog(Log.DEBUG))
+                        _log.debug("OK: " + entry);
                     okff.add(entry);
                 } else {
+                    if (_log.shouldLog(Log.DEBUG))
+                        _log.debug("Bad: " + entry);
                     badff.add(entry);
                 }
             }
         }
+        if (_log.shouldLog(Log.DEBUG))
+            _log.debug("Good: " + rv + " OK: " + okff + " Bad: " + badff);
 
         // Put the ok floodfills after the good floodfills
         for (int i = 0; found < howMany && i < okff.size(); i++) {
-- 
GitLab