Author: toad
Date: 2007-05-18 20:39:02 +0000 (Fri, 18 May 2007)
New Revision: 13266

Modified:
   trunk/freenet/src/freenet/node/PeerManager.java
Log:
Take into account backoff when deciding whether we are the closest node to the 
key.

Modified: trunk/freenet/src/freenet/node/PeerManager.java
===================================================================
--- trunk/freenet/src/freenet/node/PeerManager.java     2007-05-18 18:22:12 UTC 
(rev 13265)
+++ trunk/freenet/src/freenet/node/PeerManager.java     2007-05-18 20:39:02 UTC 
(rev 13266)
@@ -470,6 +470,7 @@
         for(int i=0;i<peers.length;i++) {
             PeerNode p = peers[i];
             if(!p.isRoutable()) continue;
+            if(p.isRoutingBackedOff()) continue;
             double peerloc = p.getLocation().getValue();
             if(Math.abs(peerloc - ignoreLoc) < Double.MIN_VALUE*2)
                continue;
@@ -483,6 +484,7 @@
         if(!foundOne) {
             for(int i=0;i<peers.length;i++) {
                 PeerNode p = peers[i];
+                if(!p.isRoutable()) continue;
                 // Ignore backoff state
                 double peerloc = p.getLocation().getValue();
                 if(Math.abs(peerloc - ignoreLoc) < Double.MIN_VALUE*2)


Reply via email to