Tor  0.4.4.0-alpha-dev
voting_schedule.h
Go to the documentation of this file.
1 /* Copyright (c) 2018-2020, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
3 
4 /**
5  * \file voting_schedule.h
6  * \brief Header file for voting_schedule.c.
7  **/
8 
9 #ifndef TOR_VOTING_SCHEDULE_H
10 #define TOR_VOTING_SCHEDULE_H
11 
12 #include "core/or/or.h"
13 
14 /** Scheduling information for a voting interval. */
15 typedef struct {
16  /** When do we generate and distribute our vote for this interval? */
17  time_t voting_starts;
18  /** When do we send an HTTP request for any votes that we haven't
19  * been posted yet?*/
21  /** When do we give up on getting more votes and generate a consensus? */
22  time_t voting_ends;
23  /** When do we send an HTTP request for any signatures we're expecting to
24  * see on the consensus? */
26  /** When do we publish the consensus? */
28 
29  /** True iff we have generated and distributed our vote. */
31  /** True iff we've requested missing votes. */
33  /** True iff we have built a consensus and sent the signatures around. */
35  /** True iff we've fetched missing signatures. */
37  /** True iff we have published our consensus. */
39 
40  /* True iff this voting schedule was set on demand meaning not through the
41  * normal vote operation of a dirauth or when a consensus is set. This only
42  * applies to a directory authority that needs to recalculate the voting
43  * timings only for the first vote even though this object was initilized
44  * prior to voting. */
45  int created_on_demand;
46 
47  /** The valid-after time of the last live consensus that filled this voting
48  * schedule. It's used to detect outdated voting schedules. */
51 
52 /* Public API. */
53 
54 extern voting_schedule_t voting_schedule;
55 
57  time_t now);
58 
60  int interval,
61  int offset);
62 time_t voting_schedule_get_next_valid_after_time(void);
63 
64 #endif /* !defined(TOR_VOTING_SCHEDULE_H) */
void voting_schedule_recalculate_timing(const or_options_t *options, time_t now)
time_t voting_schedule_get_start_of_next_interval(time_t now, int interval, int offset)
time_t fetch_missing_signatures
time_t live_consensus_valid_after
Master header file for Tor-specific functionality.
int have_fetched_missing_signatures