Author: zothar
Date: 2006-05-18 03:57:03 +0000 (Thu, 18 May 2006)
New Revision: 8755

Modified:
   trunk/freenet/src/freenet/node/PeerNode.java
Log:
Activate the user build too old alerting commited in r8754.  We only alert if 
we get a handshake request from a peer that's still advertising a 
lastGoodVersion that's newer than our version.  This allows the lastGoodVersion 
to be lowered and thus older nodes would potentially be able to connect again.  
This commit also removes the handshake timer renew when we receive a handshake 
from a peer that's too old because, otherwise, that might prevent us from 
sending them our ref (and the latest lastGoodVersion information) in a 
handshake request sent to them.  Persons running builds after this that are too 
old should get the idea pretty quick with a user alert on the welcome page and 
one or more peers in "TOO NEW" status on the Darknet Connections page.

Modified: trunk/freenet/src/freenet/node/PeerNode.java
===================================================================
--- trunk/freenet/src/freenet/node/PeerNode.java        2006-05-18 03:33:53 UTC 
(rev 8754)
+++ trunk/freenet/src/freenet/node/PeerNode.java        2006-05-18 03:57:03 UTC 
(rev 8755)
@@ -854,10 +854,20 @@
             Logger.error(this, "Failed to parse new noderef for "+this+": 
"+e1, e1);
             // Treat as invalid version
         }
+        if(reverseInvalidVersion()) {
+            verifiedIncompatibleNewerVersion = true;
+            try {
+                
node.setNewestPeerLastGoodVersion(Version.getArbitraryBuildNumber(lastGoodVersion));
+            } catch (NumberFormatException e) {
+                // ignore
+            }
+            Logger.normal(this, "Not connecting to "+this+" - reverse invalid 
version "+Version.getVersionString()+" for peer's lastGoodversion: 
"+lastGoodVersion);
+            isConnected = false;
+            node.peers.disconnected(this);
+            return false;
+            }
         if(invalidVersion()) {
             Logger.normal(this, "Not connecting to "+this+" - invalid version 
"+version);
-            // Update the next time to check
-            sentHandshake();
             isConnected = false;
             node.peers.disconnected(this);
             return false;


Reply via email to