]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add some debugging logs related to dir vote timing.
authorNick Mathewson <nickm@torproject.org>
Mon, 15 Oct 2007 20:37:59 +0000 (20:37 +0000)
committerNick Mathewson <nickm@torproject.org>
Mon, 15 Oct 2007 20:37:59 +0000 (20:37 +0000)
svn:r11952

src/or/dirserv.c
src/or/dirvote.c

index addb3f4fc30404bc4fec90a69ac462a3153c97c2..02277b8718852e027b1553955fbc6d58a93f9089 100644 (file)
@@ -1939,6 +1939,7 @@ generate_networkstatus_vote_obj(crypto_pk_env_t *private_key,
   dirvote_get_preferred_voting_intervals(&timing);
   v3_out->published = now;
   {
+    char tbuf[ISO_TIME_LEN+1];
     networkstatus_vote_t *current_consensus =
       networkstatus_get_live_consensus(now);
     time_t consensus_interval;
@@ -1949,6 +1950,10 @@ generate_networkstatus_vote_obj(crypto_pk_env_t *private_key,
       consensus_interval = timing.vote_interval;
     v3_out->valid_after =
       dirvote_get_start_of_next_interval(now, consensus_interval);
+    format_iso_time(tbuf, v3_out->valid_after);
+    log_notice(LD_DIR,"Choosing valid-after time in vote as %s: "
+               "consensus_set=%d, interval=%d",
+               tbuf, current_consensus?1:0, consensus_interval);
   }
   v3_out->fresh_until = v3_out->valid_after + timing.vote_interval;
   v3_out->valid_until = v3_out->valid_after +
index 44a1edcb3cf839beb11d616006303f82b8f2ea39..7e131ef4631b0cea5aba45eec31f6a7d2addfa49 100644 (file)
@@ -1092,6 +1092,14 @@ dirvote_recalculate_timing(time_t now)
   voting_schedule.voting_ends = start - dist_delay;
   voting_schedule.fetch_missing_votes = start - dist_delay - (vote_delay/2);
   voting_schedule.voting_starts = start - dist_delay - vote_delay;
+
+  {
+    char tbuf[ISO_TIME_LEN+1];
+    format_iso_time(tbuf, voting_schedule.interval_starts);
+    log_notice(LD_DIR,"Choosing expected valid-after time as %s: "
+               "consensus_set=%d, interval=%d",
+               tbuf, consensus?1:0, interval);
+  }
 }
 
 /** Entry point: Take whatever voting actions are pending as of <b>now</b>. */