Author: toad
Date: 2008-08-06 17:42:25 +0000 (Wed, 06 Aug 2008)
New Revision: 21640
Modified:
trunk/freenet/src/freenet/node/Announcer.java
Log:
Maybe fix announcing on a testnet
Modified: trunk/freenet/src/freenet/node/Announcer.java
===================================================================
--- trunk/freenet/src/freenet/node/Announcer.java 2008-08-06 17:06:49 UTC
(rev 21639)
+++ trunk/freenet/src/freenet/node/Announcer.java 2008-08-06 17:42:25 UTC
(rev 21640)
@@ -420,14 +420,24 @@
announcedToIPs.add(addrs[i]);
}
+ /**
+ * Have we already announced to this node?
+ * Return true if the node has new non-local addresses we haven't
announced to.
+ * Return false if the node has non-local addresses we have announced
to.
+ * Return true if the node has no non-local addresses.
+ * @param addrs
+ * @return
+ */
private synchronized boolean newAnnouncedIPs(InetAddress[] addrs) {
+ boolean hasNonLocalAddresses = false;
for(int i=0;i<addrs.length;i++) {
if(!IPUtil.isValidAddress(addrs[i], false))
continue;
+ hasNonLocalAddresses = true;
if(!announcedToIPs.contains(addrs[i]))
return true;
}
- return false;
+ return !hasNonLocalAddresses;
}
public void sendAnnouncement(final SeedServerPeerNode seed) {