Rename them from dirvote_* to voting_schedule_*.
No code behavior change.
Part of #25988
Signed-off-by: David Goulet <dgoulet@torproject.org>
else
last_consensus_interval = options->TestingV3AuthInitialVotingInterval;
v3_out->valid_after =
- dirvote_get_start_of_next_interval(now, (int)last_consensus_interval,
- options->TestingV3AuthVotingStartOffset);
+ voting_schedule_get_start_of_next_interval(now,
+ (int)last_consensus_interval,
+ options->TestingV3AuthVotingStartOffset);
format_iso_time(tbuf, v3_out->valid_after);
log_notice(LD_DIR,"Choosing valid-after time in vote as %s: "
"consensus_set=%d, last_interval=%d",
}
/* Prepare our state so that it's ready for the next voting period. */
- sr_state_update(dirvote_get_next_valid_after_time());
+ sr_state_update(voting_schedule_get_next_valid_after_time());
}
/* Initialize shared random subsystem. This MUST be called early in the boot
/* We have a state in memory, let's make sure it's updated for the current
* and next voting round. */
{
- time_t valid_after = dirvote_get_next_valid_after_time();
+ time_t valid_after = voting_schedule_get_next_valid_after_time();
sr_state_update(valid_after);
}
return 0;
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 = dirvote_get_next_valid_after_time();
+ time_t next_start = voting_schedule_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 = dirvote_get_start_of_next_interval(
+ time_t curr_start = voting_schedule_get_start_of_next_interval(
next_start - voting_interval - 1,
voting_interval,
options->TestingV3AuthVotingStartOffset);
#include "config.h"
#include "networkstatus.h"
+#include "dirauth/dirvote.h"
+
/* =====
* Vote scheduling
* ===== */
* truncated to less than half its size, it is rolled into the
* previous interval. */
time_t
-dirvote_get_start_of_next_interval(time_t now, int interval, int offset)
+voting_schedule_get_start_of_next_interval(time_t now, int interval,
+ int offset)
{
struct tm tm;
time_t midnight_today=0;
vote_delay = dist_delay = interval / 4;
start = new_voting_schedule->interval_starts =
- dirvote_get_start_of_next_interval(now,interval,
+ voting_schedule_get_start_of_next_interval(now,interval,
options->TestingV3AuthVotingStartOffset);
- end = dirvote_get_start_of_next_interval(start+1, interval,
+ end = voting_schedule_get_start_of_next_interval(start+1, interval,
options->TestingV3AuthVotingStartOffset);
tor_assert(end > start);
/* Using the time <b>now</b>, return the next voting valid-after time. */
time_t
-dirvote_get_next_valid_after_time(void)
+voting_schedule_get_next_valid_after_time(void)
{
/* This is a safe guard in order to make sure that the voting schedule
* static object is at least initialized. Using this function with a zeroed
#include "or.h"
-/* Dirauth module. */
-#include "dirauth/dirvote.h"
-
/** Scheduling information for a voting interval. */
typedef struct {
/** When do we generate and distribute our vote for this interval? */
extern voting_schedule_t voting_schedule;
-time_t dirvote_get_start_of_next_interval(time_t now,
- int interval,
- int offset);
-time_t dirvote_get_next_valid_after_time(void);
+time_t voting_schedule_get_start_of_next_interval(time_t now,
+ int interval,
+ int offset);
+time_t voting_schedule_get_next_valid_after_time(void);
#endif /* TOR_VOTING_SCHEDULE_H */