Make voting_schedule.h work correctly when dirauth-mode is disabled.

This commit is contained in:
Nick Mathewson 2020-02-24 11:56:55 -05:00 committed by George Kadianakis
parent 9fb18756df
commit 1b66b39699

View File

@ -11,6 +11,8 @@
#include "core/or/or.h"
#ifdef HAVE_MODULE_DIRAUTH
/** Scheduling information for a voting interval. */
typedef struct {
/** When do we generate and distribute our vote for this interval? */
@ -63,4 +65,29 @@ time_t dirauth_sched_get_next_valid_after_time(void);
time_t dirauth_sched_get_cur_valid_after_time(void);
int dirauth_sched_get_configured_interval(void);
#else /* !defined(HAVE_MODULE_DIRAUTH) */
#define dirauth_sched_recalculate_timing(opt,now) \
((void)(opt), (void)(now))
static inline time_t
dirauth_sched_get_next_valid_after_time(void)
{
tor_assert_unreached();
return 0;
}
static inline time_t
dirauth_sched_get_cur_valid_after_time(void)
{
tor_assert_unreached();
return 0;
}
static inline int
dirauth_sched_get_configured_interval(void)
{
tor_assert_unreached();
return 1;
}
#endif /* defined(HAVE_MODULE_DIRAUTH) */
#endif /* !defined(TOR_VOTING_SCHEDULE_H) */