Author: toad
Date: 2006-12-09 16:22:32 +0000 (Sat, 09 Dec 2006)
New Revision: 11312
Modified:
trunk/freenet/src/freenet/node/NodeIPDetector.java
Log:
NodeIPDetector wasn't counting the popularity of IP's correctly.
Modified: trunk/freenet/src/freenet/node/NodeIPDetector.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeIPDetector.java 2006-12-09 01:25:00 UTC
(rev 11311)
+++ trunk/freenet/src/freenet/node/NodeIPDetector.java 2006-12-09 16:22:32 UTC
(rev 11312)
@@ -64,7 +64,7 @@
primaryIPUndetectedAlert = new IPUndetectedUserAlert(node);
arkPutter = new NodeARKInserter(node, this);
}
-
+
/**
* @return Our current main IP address.
* FIXME - we should support more than 1, and we should do the
@@ -147,10 +147,9 @@
Peer p = peerList[i].getRemoteDetectedPeer();
if((p == null) || p.isNull()) continue;
// DNSRequester doesn't deal with our own node
- InetAddress ip = p.getAddress(true);
- if(!IPUtil.isValidAddress(ip, false)) continue;
+ if(!IPUtil.isValidAddress(p.getAddress(true),
false)) continue;
Logger.normal(this, "Peer
"+peerList[i].getPeer()+" thinks we are "+p);
- if(countsByPeer.containsKey(ip)) {
+ if(countsByPeer.containsKey(p)) {
Integer count = (Integer)
countsByPeer.get(p);
Integer newCount = new
Integer(count.intValue()+1);
countsByPeer.put(p, newCount);