summaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_common.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2021-01-12 10:54:31 -0500
committerDavid Goulet <dgoulet@torproject.org>2021-01-12 10:54:31 -0500
commitb3652f2104c880bf626cb4e97e6088bca5a1571f (patch)
tree6cb537a2bc8f367f626f3dd728eb626d4041617d /src/feature/hs/hs_common.c
parent5a822b462aaa8cf3cd749c253bb1e9e5f4f37fa2 (diff)
parent0485c7ddba8c3474d1be8972caa9505b09d65644 (diff)
downloadtor-b3652f2104c880bf626cb4e97e6088bca5a1571f.tar.gz
tor-b3652f2104c880bf626cb4e97e6088bca5a1571f.zip
Merge branch 'ticket40237_043_01' into ticket40237_044_01
Diffstat (limited to 'src/feature/hs/hs_common.c')
-rw-r--r--src/feature/hs/hs_common.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/feature/hs/hs_common.c b/src/feature/hs/hs_common.c
index 4639cdb68a..86d3fcab7d 100644
--- a/src/feature/hs/hs_common.c
+++ b/src/feature/hs/hs_common.c
@@ -27,6 +27,7 @@
#include "feature/hs/hs_service.h"
#include "feature/hs_common/shared_random_client.h"
#include "feature/nodelist/describe.h"
+#include "feature/nodelist/microdesc.h"
#include "feature/nodelist/networkstatus.h"
#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerset.h"
@@ -276,7 +277,9 @@ hs_get_time_period_num(time_t now)
if (now != 0) {
current_time = now;
} else {
- networkstatus_t *ns = networkstatus_get_live_consensus(approx_time());
+ networkstatus_t *ns =
+ networkstatus_get_reasonably_live_consensus(approx_time(),
+ usable_consensus_flavor());
current_time = ns ? ns->valid_after : approx_time();
}
@@ -1107,7 +1110,8 @@ hs_in_period_between_tp_and_srv,(const networkstatus_t *consensus, time_t now))
time_t srv_start_time, tp_start_time;
if (!consensus) {
- consensus = networkstatus_get_live_consensus(now);
+ consensus = networkstatus_get_reasonably_live_consensus(now,
+ usable_consensus_flavor());
if (!consensus) {
return 0;
}
@@ -1352,7 +1356,9 @@ hs_get_responsible_hsdirs(const ed25519_public_key_t *blinded_pk,
sorted_nodes = smartlist_new();
/* Make sure we actually have a live consensus */
- networkstatus_t *c = networkstatus_get_live_consensus(approx_time());
+ networkstatus_t *c =
+ networkstatus_get_reasonably_live_consensus(approx_time(),
+ usable_consensus_flavor());
if (!c || smartlist_len(c->routerstatus_list) == 0) {
log_warn(LD_REND, "No live consensus so we can't get the responsible "
"hidden service directories.");