Author: toad
Date: 2006-12-09 16:26:05 +0000 (Sat, 09 Dec 2006)
New Revision: 11313

Modified:
   trunk/freenet/src/freenet/node/NodeIPDetector.java
Log:
Include an IP if two nodes agree on it (and it's the most popular or second 
most popular).

Modified: trunk/freenet/src/freenet/node/NodeIPDetector.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeIPDetector.java  2006-12-09 16:22:32 UTC 
(rev 11312)
+++ trunk/freenet/src/freenet/node/NodeIPDetector.java  2006-12-09 16:26:05 UTC 
(rev 11313)
@@ -185,14 +185,14 @@
                                        }
                                }
                                if(best != null) {
-                                       if((bestPopularity > 2) || 
(detectedAddrs.length == 0)) {
-                                               if(!addresses.contains(best)) {
+                                       if((bestPopularity > 1) || 
(detectedAddrs.length == 0)) {
+                                               if(!addresses.contains(best)) {
                                                        Logger.normal(this, 
"Adding best peer "+best+" ("+bestPopularity+ ')');
                                                        addresses.add(best);
                                                        
if(best.getFreenetAddress().isRealInternetAddress(false, false))
                                                                addedValidIP = 
true;
                                                }
-                                               if((secondBest != null) && 
(secondBestPopularity > 2)) {
+                                               if((secondBest != null) && 
(secondBestPopularity > 1)) {
                                                        
if(!addresses.contains(secondBest)) {
                                                                
Logger.normal(this, "Adding second best peer "+secondBest+" ("+secondBest+ ')');
                                                                
addresses.add(secondBest);


Reply via email to