summaryrefslogtreecommitdiff
path: root/src/feature/dirauth/shared_random.c
diff options
context:
space:
mode:
authorNeel Chauhan <neel@neelc.org>2017-09-19 16:08:24 -0400
committerDavid Goulet <dgoulet@torproject.org>2018-11-30 12:16:18 -0500
commitd18a167ff38799ea5cd846dd80acccab6404952a (patch)
treecc62e2ef88ef2c5460fc31f688e45a4b602c88d2 /src/feature/dirauth/shared_random.c
parent72c1303cef629576cb8d078590ed71091828fd78 (diff)
downloadtor-d18a167ff38799ea5cd846dd80acccab6404952a.tar.gz
tor-d18a167ff38799ea5cd846dd80acccab6404952a.zip
sr: Switch from tor_assert() to BUG()
Closes #19566 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/dirauth/shared_random.c')
-rw-r--r--src/feature/dirauth/shared_random.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/feature/dirauth/shared_random.c b/src/feature/dirauth/shared_random.c
index db4f9d328c..b027d9e375 100644
--- a/src/feature/dirauth/shared_random.c
+++ b/src/feature/dirauth/shared_random.c
@@ -949,7 +949,8 @@ sr_compute_srv(void)
/* Computing a shared random value in the commit phase is very wrong. This
* should only happen at the very end of the reveal phase when a new
* protocol run is about to start. */
- tor_assert(sr_state_get_phase() == SR_PHASE_REVEAL);
+ if (BUG(sr_state_get_phase() != SR_PHASE_REVEAL))
+ return;
state_commits = sr_state_get_commits();
commits = smartlist_new();