Browse Source

reset published uptime when you wake up from hibernation,
since if you hibernate daily a published uptime of >1day
will be misleading.


svn:r3356

Roger Dingledine 20 years ago
parent
commit
c6771e5ce4
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/or/hibernate.c

+ 3 - 0
src/or/hibernate.c

@@ -31,6 +31,8 @@ hibernating, phase 2:
 
 #define SHUTDOWN_WAIT_LENGTH 30 /* seconds */
 
+extern long stats_n_seconds_working; /* published uptime */
+
 static int hibernate_state = HIBERNATE_STATE_LIVE;
 /** If are hibernating, when do we plan to wake up? Set to 0 if we
  * aren't hibernating. */
@@ -693,6 +695,7 @@ hibernate_end(int new_state) {
 
   hibernate_state = new_state;
   hibernate_end_time = 0; /* no longer hibernating */
+  stats_n_seconds_working = 0; /* reset published uptime */
 }
 
 /** A wrapper around hibernate_begin, for when we get SIGINT. */