aboutsummaryrefslogtreecommitdiff
path: root/src/feature/dirauth
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-02-24 11:56:55 -0500
committerGeorge Kadianakis <desnacked@riseup.net>2020-03-03 14:35:01 +0200
commit1b66b39699e31adb3f10717e5bd252f294f7636f (patch)
tree7ca0dfd3f7367ea63a752dc94078a4a308c481da /src/feature/dirauth
parent9fb18756df3f76545f8f591881a95e1e09e735a0 (diff)
downloadtor-1b66b39699e31adb3f10717e5bd252f294f7636f.tar.gz
tor-1b66b39699e31adb3f10717e5bd252f294f7636f.zip
Make voting_schedule.h work correctly when dirauth-mode is disabled.
Diffstat (limited to 'src/feature/dirauth')
-rw-r--r--src/feature/dirauth/voting_schedule.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/feature/dirauth/voting_schedule.h b/src/feature/dirauth/voting_schedule.h
index 5472719b25..9e2ac29c75 100644
--- a/src/feature/dirauth/voting_schedule.h
+++ b/src/feature/dirauth/voting_schedule.h
@@ -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) */