mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-14 07:03:44 +01:00
dirvote: Make dirvote_get_preferred_voting_intervals() static
This function doesn't need to be public from the dirvote common file (which will get renamed in future commit) so move it to dirauth/dirvote.c and make it static. Part of #25988 Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
parent
098b7fe25b
commit
6452fe78c2
@ -374,6 +374,22 @@ format_networkstatus_vote(crypto_pk_t *private_signing_key,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Set *<b>timing_out</b> to the intervals at which we would like to vote.
|
||||||
|
* Note that these aren't the intervals we'll use to vote; they're the ones
|
||||||
|
* that we'll vote to use. */
|
||||||
|
static void
|
||||||
|
dirvote_get_preferred_voting_intervals(vote_timing_t *timing_out)
|
||||||
|
{
|
||||||
|
const or_options_t *options = get_options();
|
||||||
|
|
||||||
|
tor_assert(timing_out);
|
||||||
|
|
||||||
|
timing_out->vote_interval = options->V3AuthVotingInterval;
|
||||||
|
timing_out->n_intervals_valid = options->V3AuthNIntervalsValid;
|
||||||
|
timing_out->vote_delay = options->V3AuthVoteDelay;
|
||||||
|
timing_out->dist_delay = options->V3AuthDistDelay;
|
||||||
|
}
|
||||||
|
|
||||||
/* =====
|
/* =====
|
||||||
* Consensus generation
|
* Consensus generation
|
||||||
* ===== */
|
* ===== */
|
||||||
|
@ -19,22 +19,6 @@
|
|||||||
* Vote scheduling
|
* Vote scheduling
|
||||||
* ===== */
|
* ===== */
|
||||||
|
|
||||||
/** Set *<b>timing_out</b> to the intervals at which we would like to vote.
|
|
||||||
* Note that these aren't the intervals we'll use to vote; they're the ones
|
|
||||||
* that we'll vote to use. */
|
|
||||||
void
|
|
||||||
dirvote_get_preferred_voting_intervals(vote_timing_t *timing_out)
|
|
||||||
{
|
|
||||||
const or_options_t *options = get_options();
|
|
||||||
|
|
||||||
tor_assert(timing_out);
|
|
||||||
|
|
||||||
timing_out->vote_interval = options->V3AuthVotingInterval;
|
|
||||||
timing_out->n_intervals_valid = options->V3AuthNIntervalsValid;
|
|
||||||
timing_out->vote_delay = options->V3AuthVoteDelay;
|
|
||||||
timing_out->dist_delay = options->V3AuthDistDelay;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Return the start of the next interval of size <b>interval</b> (in
|
/** Return the start of the next interval of size <b>interval</b> (in
|
||||||
* seconds) after <b>now</b>, plus <b>offset</b>. Midnight always
|
* seconds) after <b>now</b>, plus <b>offset</b>. Midnight always
|
||||||
* starts a fresh interval, and if the last interval of a day would be
|
* starts a fresh interval, and if the last interval of a day would be
|
||||||
|
@ -52,7 +52,6 @@ typedef struct {
|
|||||||
|
|
||||||
extern voting_schedule_t voting_schedule;
|
extern voting_schedule_t voting_schedule;
|
||||||
|
|
||||||
void dirvote_get_preferred_voting_intervals(vote_timing_t *timing_out);
|
|
||||||
time_t dirvote_get_start_of_next_interval(time_t now,
|
time_t dirvote_get_start_of_next_interval(time_t now,
|
||||||
int interval,
|
int interval,
|
||||||
int offset);
|
int offset);
|
||||||
|
Loading…
Reference in New Issue
Block a user