Author: toad
Date: 2008-09-03 22:20:01 +0000 (Wed, 03 Sep 2008)
New Revision: 22392
Modified:
trunk/freenet/src/freenet/node/NodeIPDetector.java
Log:
Whether or not we want to include local addresses in the noderef makes no
difference: we should try to find our address from our peers if we have no
locally detected valid address in either case.
Modified: trunk/freenet/src/freenet/node/NodeIPDetector.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeIPDetector.java 2008-09-03 22:12:36 UTC
(rev 22391)
+++ trunk/freenet/src/freenet/node/NodeIPDetector.java 2008-09-03 22:20:01 UTC
(rev 22392)
@@ -248,7 +248,12 @@
}
}
if(best != null) {
- if((bestPopularity > 1) ||
(detectedAddrs.length == 0)) {
+ boolean hasRealDetectedAddress = false;
+ for(int i=0;i<detectedAddrs.length;i++)
{
+
if(IPUtil.isValidAddress(detectedAddrs[i], false))
+ hasRealDetectedAddress
= true;
+ }
+ if((bestPopularity > 1) ||
!hasRealDetectedAddress) {
if(!addresses.contains(best)) {
Logger.minor(this,
"Adding best peer "+best+" ("+bestPopularity+ ')');
addresses.add(best);