Author: toad
Date: 2006-06-03 00:31:23 +0000 (Sat, 03 Jun 2006)
New Revision: 9015

Modified:
   trunk/freenet/src/freenet/node/updater/NodeUpdater.java
Log:
more node updater fixes

Modified: trunk/freenet/src/freenet/node/updater/NodeUpdater.java
===================================================================
--- trunk/freenet/src/freenet/node/updater/NodeUpdater.java     2006-06-03 
00:16:25 UTC (rev 9014)
+++ trunk/freenet/src/freenet/node/updater/NodeUpdater.java     2006-06-03 
00:31:23 UTC (rev 9015)
@@ -129,17 +129,19 @@
                }
        }

-       public synchronized void maybeUpdate(){
-               try{
-                       if(isFetching || !isRunning || !isUpdatable()) return;
-               }catch (PrivkeyHasBeenBlownException e){
-                       // how to handle it ? a new UserAlert or an imediate 
exit?
-                       Logger.error(this, "The auto-updating Private key has 
been blown!");
-                       node.exit();
+       public void maybeUpdate(){
+               synchronized(this) {
+                       try{
+                               if(isFetching || (!isRunning) || 
(!isUpdatable())) return;
+                       }catch (PrivkeyHasBeenBlownException e){
+                               // how to handle it ? a new UserAlert or an 
imediate exit?
+                               Logger.error(this, "The auto-updating Private 
key has been blown!");
+                               System.err.println("The auto-updating Private 
key has been blown!");
+                               node.exit();
+                       }
+                       
+                       isRunning=false;
                }
-               
-               isRunning=false;
-               
                //TODO maybe a UpdateInProgress alert ?
                Logger.normal(this,"Starting the update process");
                System.err.println("Starting the update process: found the 
update, now fetching it.");


Reply via email to