Author: toad
Date: 2006-07-22 19:49:41 +0000 (Sat, 22 Jul 2006)
New Revision: 9716

Modified:
   trunk/freenet/src/freenet/node/PeerNode.java
Log:
minor locking changes. i wonder if completedHandshake is reentrant...

Modified: trunk/freenet/src/freenet/node/PeerNode.java
===================================================================
--- trunk/freenet/src/freenet/node/PeerNode.java        2006-07-22 17:16:16 UTC 
(rev 9715)
+++ trunk/freenet/src/freenet/node/PeerNode.java        2006-07-22 19:49:41 UTC 
(rev 9716)
@@ -1234,6 +1234,7 @@
                completedHandshake = true;
                handshakeCount = 0;
                bogusNoderef = false;
+                       isConnected = true;
         }
                try {
                        // First, the new noderef
@@ -1277,15 +1278,13 @@
                                verifiedIncompatibleOlderVersion = false;
                        }
                }
-       synchronized(this) {
-                       isConnected = true;
-               }
                setPeerNodeStatus(now);
                KeyTracker newTracker = new KeyTracker(this, encCipher, encKey);
                changedIP(replyTo);
                boolean bootIDChanged = false;
        synchronized(this) {
                        bootIDChanged = (thisBootID != this.bootID);
+                       this.bootID = thisBootID;
                }
                if(bootIDChanged) {
                synchronized(this) {
@@ -1319,9 +1318,6 @@
                                }
                                old.completelyDeprecated(newTracker);
                        }
-                       synchronized(this) {
-                               this.bootID = thisBootID;
-                       }
                        node.lm.lostOrRestartedNode(this);
                } // else it's a rekey



Reply via email to