r13985@Kushana: nickm | 2007-08-13 16:05:07 -0400

Fix some simple logic errors in voting.


svn:r11089
This commit is contained in:
Nick Mathewson
2007-08-13 20:05:25 +00:00
parent 2d07cce67f
commit 936edd901d
2 changed files with 6 additions and 3 deletions
-1
View File
@@ -2221,7 +2221,6 @@ generate_v3_networkstatus(void)
cached_dir_decref(*ns_ptr);
*ns_ptr = new_cached_dir(status, now);
status = NULL; /* So it doesn't get double-freed. */
router_set_networkstatus((*ns_ptr)->dir, now, NS_GENERATED, NULL);
}
return the_v3_networkstatus_vote;
+6 -2
View File
@@ -1064,7 +1064,8 @@ dirvote_recalculate_timing(time_t now)
dist_delay = consensus->dist_seconds;
} else {
/* XXXX020 is this correct according the the spec? */
interval = 3600;
/* XXXX020 drop this back down to 60 minutes, or whatever the spec says. */
interval = 1200;
vote_delay = dist_delay = 300;
}
@@ -1132,7 +1133,10 @@ dirvote_perform_vote(void)
pending_vote_t *pending_vote;
const char *msg = "";
if ((pending_vote = dirvote_add_vote(new_vote->dir, &msg))) {
if (!new_vote)
return;
if (!(pending_vote = dirvote_add_vote(new_vote->dir, &msg))) {
log_warn(LD_DIR, "Couldn't store my own vote! (I told myself, '%s'.)",
msg);
return;