[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r12022: Stop incessant notices about when we think the expected vali (in tor/trunk: . src/or)



Author: nickm
Date: 2007-10-18 10:27:42 -0400 (Thu, 18 Oct 2007)
New Revision: 12022

Modified:
   tor/trunk/
   tor/trunk/src/or/dirvote.c
   tor/trunk/src/or/main.c
   tor/trunk/src/or/networkstatus.c
   tor/trunk/src/or/or.h
Log:
 r15915@catbus:  nickm | 2007-10-18 10:26:44 -0400
 Stop incessant notices about when we think the expected valid-after time should be, if we are not an authority.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r15915] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/or/dirvote.c
===================================================================
--- tor/trunk/src/or/dirvote.c	2007-10-18 14:23:19 UTC (rev 12021)
+++ tor/trunk/src/or/dirvote.c	2007-10-18 14:27:42 UTC (rev 12022)
@@ -1061,13 +1061,18 @@
 /** Set voting_schedule to hold the timing for the next vote we should be
  * doing. */
 void
-dirvote_recalculate_timing(time_t now)
+dirvote_recalculate_timing(or_options_t *options, time_t now)
 {
   int interval, vote_delay, dist_delay;
   time_t start;
   time_t end;
-  networkstatus_vote_t *consensus = networkstatus_get_live_consensus(now);
+  networkstatus_vote_t *consensus;
 
+  if (!authdir_mode_v3(options))
+    return;
+
+  consensus = networkstatus_get_live_consensus(now);
+
   memset(&voting_schedule, 0, sizeof(voting_schedule));
 
   if (consensus) {
@@ -1106,8 +1111,10 @@
 
 /** Entry point: Take whatever voting actions are pending as of <b>now</b>. */
 void
-dirvote_act(time_t now)
+dirvote_act(or_options_t *options, time_t now)
 {
+  if (!authdir_mode_v3(options))
+    return;
   if (!voting_schedule.voting_starts) {
     char *keys = list_v3_auth_ids();
     authority_cert_t *c = get_my_v3_authority_cert();
@@ -1115,7 +1122,7 @@
                "Mine is %s.",
                keys, hex_str(c->cache_info.identity_digest, DIGEST_LEN));
     tor_free(keys);
-    dirvote_recalculate_timing(now);
+    dirvote_recalculate_timing(options, now);
   }
   if (voting_schedule.voting_starts < now && !voting_schedule.have_voted) {
     log_notice(LD_DIR, "Time to vote.");
@@ -1150,7 +1157,7 @@
     voting_schedule.have_published_consensus = 1;
     /* XXXX020 we will want to try again later if we haven't got enough
      * signatures yet. */
-    dirvote_recalculate_timing(now);
+    dirvote_recalculate_timing(options, now);
   }
 }
 

Modified: tor/trunk/src/or/main.c
===================================================================
--- tor/trunk/src/or/main.c	2007-10-18 14:23:19 UTC (rev 12021)
+++ tor/trunk/src/or/main.c	2007-10-18 14:27:42 UTC (rev 12022)
@@ -1006,7 +1006,7 @@
 
   /** 2c. Let directory voting happen. */
   if (authdir_mode_v3(options))
-    dirvote_act(now);
+    dirvote_act(options, now);
 
   /** 3a. Every second, we examine pending circuits and prune the
    *    ones which have been pending for more than a few seconds.

Modified: tor/trunk/src/or/networkstatus.c
===================================================================
--- tor/trunk/src/or/networkstatus.c	2007-10-18 14:23:19 UTC (rev 12021)
+++ tor/trunk/src/or/networkstatus.c	2007-10-18 14:27:42 UTC (rev 12022)
@@ -984,7 +984,7 @@
   current_consensus = c;
 
   update_consensus_networkstatus_fetch_time(now);
-  dirvote_recalculate_timing(now);
+  dirvote_recalculate_timing(get_options(), now);
   routerstatus_list_update_named_server_map();
 
   if (!from_cache) {

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2007-10-18 14:23:19 UTC (rev 12021)
+++ tor/trunk/src/or/or.h	2007-10-18 14:27:42 UTC (rev 12022)
@@ -2932,8 +2932,8 @@
 /* vote scheduling */
 void dirvote_get_preferred_voting_intervals(vote_timing_t *timing_out);
 time_t dirvote_get_start_of_next_interval(time_t now, int interval);
-void dirvote_recalculate_timing(time_t now);
-void dirvote_act(time_t now);
+void dirvote_recalculate_timing(or_options_t *options, time_t now);
+void dirvote_act(or_options_t *options, time_t now);
 
 /* invoked on timers and by outside triggers. */
 struct pending_vote_t * dirvote_add_vote(const char *vote_body,