diff options
Diffstat (limited to 'src/feature')
-rw-r--r-- | src/feature/dirauth/dirauth_config.c | 2 | ||||
-rw-r--r-- | src/feature/dirauth/dirvote.c | 6 | ||||
-rw-r--r-- | src/feature/dirauth/shared_random.c | 2 | ||||
-rw-r--r-- | src/feature/dirauth/shared_random_state.c | 2 | ||||
-rw-r--r-- | src/feature/dirauth/voting_schedule.c | 10 | ||||
-rw-r--r-- | src/feature/dirauth/voting_schedule.h | 4 | ||||
-rw-r--r-- | src/feature/hs_common/shared_random_client.c | 4 | ||||
-rw-r--r-- | src/feature/nodelist/networkstatus.c | 4 | ||||
-rw-r--r-- | src/feature/nodelist/networkstatus.h | 2 |
9 files changed, 18 insertions, 18 deletions
diff --git a/src/feature/dirauth/dirauth_config.c b/src/feature/dirauth/dirauth_config.c index 6ee8a4a306..38d2a8bc5a 100644 --- a/src/feature/dirauth/dirauth_config.c +++ b/src/feature/dirauth/dirauth_config.c @@ -305,7 +305,7 @@ options_act_dirauth(const or_options_t *old_options) /* We may need to reschedule some dirauth stuff if our status changed. */ if (old_options) { if (options_transition_affects_dirauth_timing(old_options, options)) { - voting_schedule_recalculate_timing(options, time(NULL)); + dirauth_sched_recalculate_timing(options, time(NULL)); reschedule_dirvote(options); } } diff --git a/src/feature/dirauth/dirvote.c b/src/feature/dirauth/dirvote.c index 8f3e6eb182..cc0850ab59 100644 --- a/src/feature/dirauth/dirvote.c +++ b/src/feature/dirauth/dirvote.c @@ -2850,7 +2850,7 @@ dirvote_act(const or_options_t *options, time_t now) "Mine is %s.", keys, hex_str(c->cache_info.identity_digest, DIGEST_LEN)); tor_free(keys); - voting_schedule_recalculate_timing(options, now); + dirauth_sched_recalculate_timing(options, now); } #define IF_TIME_FOR_NEXT_ACTION(when_field, done_field) \ @@ -2896,7 +2896,7 @@ dirvote_act(const or_options_t *options, time_t now) networkstatus_get_latest_consensus_by_flavor(FLAV_NS)); /* XXXX We will want to try again later if we haven't got enough * signatures yet. Implement this if it turns out to ever happen. */ - voting_schedule_recalculate_timing(options, now); + dirauth_sched_recalculate_timing(options, now); return voting_schedule.voting_starts; } ENDIF @@ -4628,7 +4628,7 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key, else last_consensus_interval = options->TestingV3AuthInitialVotingInterval; v3_out->valid_after = - voting_schedule_get_start_of_next_interval(now, + voting_sched_get_start_of_interval_after(now, (int)last_consensus_interval, options->TestingV3AuthVotingStartOffset); format_iso_time(tbuf, v3_out->valid_after); diff --git a/src/feature/dirauth/shared_random.c b/src/feature/dirauth/shared_random.c index 134a516eef..fd55008242 100644 --- a/src/feature/dirauth/shared_random.c +++ b/src/feature/dirauth/shared_random.c @@ -1261,7 +1261,7 @@ sr_act_post_consensus(const networkstatus_t *consensus) } /* Prepare our state so that it's ready for the next voting period. */ - sr_state_update(voting_schedule_get_next_valid_after_time()); + sr_state_update(dirauth_sched_get_next_valid_after_time()); } /** Initialize shared random subsystem. This MUST be called early in the boot diff --git a/src/feature/dirauth/shared_random_state.c b/src/feature/dirauth/shared_random_state.c index a61a1cd841..305c2cc94c 100644 --- a/src/feature/dirauth/shared_random_state.c +++ b/src/feature/dirauth/shared_random_state.c @@ -1330,7 +1330,7 @@ sr_state_init(int save_to_disk, int read_from_disk) /* We have a state in memory, let's make sure it's updated for the current * and next voting round. */ { - time_t valid_after = voting_schedule_get_next_valid_after_time(); + time_t valid_after = dirauth_sched_get_next_valid_after_time(); sr_state_update(valid_after); } return 0; diff --git a/src/feature/dirauth/voting_schedule.c b/src/feature/dirauth/voting_schedule.c index d797a93405..783d407faa 100644 --- a/src/feature/dirauth/voting_schedule.c +++ b/src/feature/dirauth/voting_schedule.c @@ -56,9 +56,9 @@ get_voting_schedule(const or_options_t *options, time_t now, int severity) vote_delay = dist_delay = interval / 4; start = new_voting_schedule->interval_starts = - voting_schedule_get_start_of_next_interval(now,interval, + voting_sched_get_start_of_interval_after(now,interval, options->TestingV3AuthVotingStartOffset); - end = voting_schedule_get_start_of_next_interval(start+1, interval, + end = voting_sched_get_start_of_interval_after(start+1, interval, options->TestingV3AuthVotingStartOffset); tor_assert(end > start); @@ -97,7 +97,7 @@ voting_schedule_t voting_schedule; /* Using the time <b>now</b>, return the next voting valid-after time. */ time_t -voting_schedule_get_next_valid_after_time(void) +dirauth_sched_get_next_valid_after_time(void) { time_t now = approx_time(); bool need_to_recalculate_voting_schedule = false; @@ -123,7 +123,7 @@ voting_schedule_get_next_valid_after_time(void) done: if (need_to_recalculate_voting_schedule) { - voting_schedule_recalculate_timing(get_options(), approx_time()); + dirauth_sched_recalculate_timing(get_options(), approx_time()); voting_schedule.created_on_demand = 1; } @@ -134,7 +134,7 @@ voting_schedule_get_next_valid_after_time(void) * doing. All type of tor do that because HS subsystem needs the timing as * well to function properly. */ void -voting_schedule_recalculate_timing(const or_options_t *options, time_t now) +dirauth_sched_recalculate_timing(const or_options_t *options, time_t now) { voting_schedule_t *new_voting_schedule; diff --git a/src/feature/dirauth/voting_schedule.h b/src/feature/dirauth/voting_schedule.h index a3bb9cfd1d..0b2ce0f12a 100644 --- a/src/feature/dirauth/voting_schedule.h +++ b/src/feature/dirauth/voting_schedule.h @@ -53,9 +53,9 @@ typedef struct { extern voting_schedule_t voting_schedule; -void voting_schedule_recalculate_timing(const or_options_t *options, +void dirauth_sched_recalculate_timing(const or_options_t *options, time_t now); -time_t voting_schedule_get_next_valid_after_time(void); +time_t dirauth_sched_get_next_valid_after_time(void); #endif /* !defined(TOR_VOTING_SCHEDULE_H) */ diff --git a/src/feature/hs_common/shared_random_client.c b/src/feature/hs_common/shared_random_client.c index 0881bf8330..b30d68fb43 100644 --- a/src/feature/hs_common/shared_random_client.c +++ b/src/feature/hs_common/shared_random_client.c @@ -63,10 +63,10 @@ get_start_time_of_current_round(void) const or_options_t *options = get_options(); int voting_interval = get_voting_interval(); /* First, get the start time of the next round */ - time_t next_start = voting_schedule_get_next_valid_after_time(); + time_t next_start = dirauth_sched_get_next_valid_after_time(); /* Now roll back next_start by a voting interval to find the start time of the current round. */ - time_t curr_start = voting_schedule_get_start_of_next_interval( + time_t curr_start = voting_sched_get_start_of_interval_after( next_start - voting_interval - 1, voting_interval, options->TestingV3AuthVotingStartOffset); diff --git a/src/feature/nodelist/networkstatus.c b/src/feature/nodelist/networkstatus.c index 6755de1a81..2188e47177 100644 --- a/src/feature/nodelist/networkstatus.c +++ b/src/feature/nodelist/networkstatus.c @@ -2120,7 +2120,7 @@ networkstatus_set_current_consensus(const char *consensus, * the first thing we need to do is recalculate the voting schedule static * object so we can use the timings in there needed by some subsystems * such as hidden service and shared random. */ - voting_schedule_recalculate_timing(options, now); + dirauth_sched_recalculate_timing(options, now); reschedule_dirvote(options); nodelist_set_consensus(c); @@ -2772,7 +2772,7 @@ networkstatus_free_all(void) * truncated to less than half its size, it is rolled into the * previous interval. */ time_t -voting_schedule_get_start_of_next_interval(time_t now, int interval, +voting_sched_get_start_of_interval_after(time_t now, int interval, int offset) { struct tm tm; diff --git a/src/feature/nodelist/networkstatus.h b/src/feature/nodelist/networkstatus.h index c376bdd371..ce050aeadc 100644 --- a/src/feature/nodelist/networkstatus.h +++ b/src/feature/nodelist/networkstatus.h @@ -153,7 +153,7 @@ void vote_routerstatus_free_(vote_routerstatus_t *rs); void set_routerstatus_from_routerinfo(routerstatus_t *rs, const node_t *node, const routerinfo_t *ri); -time_t voting_schedule_get_start_of_next_interval(time_t now, +time_t voting_sched_get_start_of_interval_after(time_t now, int interval, int offset); |