Author: toad
Date: 2008-02-29 15:30:33 +0000 (Fri, 29 Feb 2008)
New Revision: 18248

Modified:
   trunk/freenet/src/freenet/io/xfer/PacketThrottle.java
   trunk/freenet/src/freenet/node/PeerNode.java
Log:
Invert isLocalAddress() and its callers.
We were returning whether it was a remote address.

Modified: trunk/freenet/src/freenet/io/xfer/PacketThrottle.java
===================================================================
--- trunk/freenet/src/freenet/io/xfer/PacketThrottle.java       2008-02-29 
15:14:44 UTC (rev 18247)
+++ trunk/freenet/src/freenet/io/xfer/PacketThrottle.java       2008-02-29 
15:30:33 UTC (rev 18248)
@@ -188,7 +188,7 @@
                        Logger.minor(this, "Congestion control wait time: 
"+waitTime+" for "+this);
                MyCallback callback = new MyCallback();
                try {
-                       if(((PeerNode)peer).isLocalAddress()) {
+                       if(!((PeerNode)peer).isLocalAddress()) {
                                long startTime = System.currentTimeMillis();
                                overallThrottle.blockingGrab(packetSize);
                                long delayTime = System.currentTimeMillis() - 
startTime;

Modified: trunk/freenet/src/freenet/node/PeerNode.java
===================================================================
--- trunk/freenet/src/freenet/node/PeerNode.java        2008-02-29 15:14:44 UTC 
(rev 18247)
+++ trunk/freenet/src/freenet/node/PeerNode.java        2008-02-29 15:30:33 UTC 
(rev 18248)
@@ -3591,6 +3591,6 @@
        public boolean isLocalAddress() {
                Peer peer = getPeer();
                if(peer == null) return false; // presumably
-               return IPUtil.isValidAddress(getPeer().getAddress(), false);
+               return !IPUtil.isValidAddress(getPeer().getAddress(), false);
        }
 }


Reply via email to