diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-07-05 12:17:21 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-07-05 12:17:21 -0400 |
commit | e11cc95717736f5818745654f24a2ee5440057d2 (patch) | |
tree | 46cdae1078e1b0bb4cea6f739691085345abca7c /src/or/shared_random.c | |
parent | 87758dbebc7ab624ba7b8802478ae2dc980d90c0 (diff) | |
parent | 34bd333529a73d015561388159d7648b17fcdfa7 (diff) | |
download | tor-e11cc95717736f5818745654f24a2ee5440057d2.tar.gz tor-e11cc95717736f5818745654f24a2ee5440057d2.zip |
Merge remote-tracking branch 'asn/bug19555'
Diffstat (limited to 'src/or/shared_random.c')
-rw-r--r-- | src/or/shared_random.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/or/shared_random.c b/src/or/shared_random.c index 612e1c6bde..c9886d92b0 100644 --- a/src/or/shared_random.c +++ b/src/or/shared_random.c @@ -1293,7 +1293,6 @@ sr_get_string_for_consensus(const smartlist_t *votes, void sr_act_post_consensus(const networkstatus_t *consensus) { - time_t interval_starts; const or_options_t *options = get_options(); /* Don't act if our state hasn't been initialized. We can be called during @@ -1323,10 +1322,14 @@ sr_act_post_consensus(const networkstatus_t *consensus) sr_state_set_current_srv(srv_dup(consensus->sr_info.current_srv)); } - /* Update our internal state with the next voting interval starting time. */ - interval_starts = get_voting_schedule(options, time(NULL), - LOG_NOTICE)->interval_starts; - sr_state_update(interval_starts); + /* Prepare our state so that it's ready for the next voting period. */ + { + voting_schedule_t *voting_schedule = + get_voting_schedule(options,time(NULL), LOG_NOTICE); + time_t interval_starts = voting_schedule->interval_starts; + sr_state_update(interval_starts); + tor_free(voting_schedule); + } } /* Initialize shared random subsystem. This MUST be called early in the boot |