Author: toad
Date: 2008-09-04 19:25:26 +0000 (Thu, 04 Sep 2008)
New Revision: 22436

Modified:
   trunk/freenet/src/freenet/node/PeerNode.java
Log:
Use longestConsecutiveNotFound when deciding whether there is a problem, not 
the most recent one!
Even less leeway.


Modified: trunk/freenet/src/freenet/node/PeerNode.java
===================================================================
--- trunk/freenet/src/freenet/node/PeerNode.java        2008-09-04 19:13:26 UTC 
(rev 22435)
+++ trunk/freenet/src/freenet/node/PeerNode.java        2008-09-04 19:25:26 UTC 
(rev 22436)
@@ -3681,7 +3681,7 @@
                                                        break;
                                        }
                                if(match == -1) {
-                                       long mustHaveBeenUpAt = now - 
timeDeltas[i] * 2 - 1000;
+                                       long mustHaveBeenUpAt = now - 
(int)(timeDeltas[i] * 1.1) - 100;
                                        if(this.crypto.socket.getStartTime() > 
mustHaveBeenUpAt) {
                                                ignoredUptimeCount++;
                                        } else {
@@ -3699,7 +3699,7 @@
                        if(consecutiveNotFound > longestConsecutiveNotFound)
                                longestConsecutiveNotFound = 
consecutiveNotFound;
                        Logger.error(this, "Packets: "+packetHashes.length+" 
not found "+notFoundCount+" consecutive not found "+consecutiveNotFound+" 
longest consecutive not found "+longestConsecutiveNotFound+" ignored due to 
uptime: "+ignoredUptimeCount+" found: "+found);
-                       if(consecutiveNotFound > TRACK_PACKETS / 2) {
+                       if(longestConsecutiveNotFound > TRACK_PACKETS / 2) {
                                manyPacketsClaimedSentNotReceived = true;
                                timeManyPacketsClaimedSentNotReceived = now;
                                Logger.error(this, "" + consecutiveNotFound + " 
consecutive packets not found on " + userToString());


Reply via email to