Author: toad
Date: 2007-06-08 18:17:09 +0000 (Fri, 08 Jun 2007)
New Revision: 13496

Modified:
   trunk/freenet/src/freenet/node/PeerManager.java
Log:
Add all nodes we don't visit, not just the ones that were temporarily best

Modified: trunk/freenet/src/freenet/node/PeerManager.java
===================================================================
--- trunk/freenet/src/freenet/node/PeerManager.java     2007-06-08 18:09:48 UTC 
(rev 13495)
+++ trunk/freenet/src/freenet/node/PeerManager.java     2007-06-08 18:17:09 UTC 
(rev 13496)
@@ -610,19 +610,20 @@
                if(logMINOR) Logger.minor(this, "Ignoring because 
>maxDiff="+maxDiff);
                continue;
             }
+            double loc = p.getLocation().getValue();
             if(diff < bestDiff) {
-               double loc = p.getLocation().getValue();
-               if(bestLoc >= 0 && addUnpickedLocsTo != null) {
-                       Double d = new Double(bestLoc);
+               bestLoc = loc;
+                best = p;
+                bestDiff = diff;
+                if(logMINOR) Logger.minor(this, "New best: "+diff+" 
("+p.getLocation().getValue()+" for "+p.getPeer());
+            } else {
+               if(addUnpickedLocsTo != null) {
+                       Double d = new Double(loc);
                        // Here we can directly compare double's because they 
aren't processed in any way, and are finite and (probably) nonzero.
-                       if(logMINOR) Logger.minor(this, "Adding: "+bestLoc);
                        if(!addUnpickedLocsTo.contains(d))
                                addUnpickedLocsTo.add(d);
+                       
                }
-               bestLoc = loc;
-                best = p;
-                bestDiff = diff;
-                if(logMINOR) Logger.minor(this, "New best: "+diff+" 
("+p.getLocation().getValue()+" for "+p.getPeer());
             }
         }
         if(addUnpickedLocsTo != null && bestLoc >= 0)


Reply via email to