diff options
author | David Goulet <dgoulet@torproject.org> | 2021-01-28 12:10:39 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2021-01-28 12:10:39 -0500 |
commit | 1bdccc03a94c6f4af297d2114d3a237d33172f1f (patch) | |
tree | bbcbe9dedb6724894364f09a78c74c1e58280b3d /src/feature/hs/hs_common.c | |
parent | 045db909c2128b11b3ea02fadd0d1fce974e32e7 (diff) | |
parent | 04b0263974c7ad1327e7a193884cf31d55f7949a (diff) | |
download | tor-1bdccc03a94c6f4af297d2114d3a237d33172f1f.tar.gz tor-1bdccc03a94c6f4af297d2114d3a237d33172f1f.zip |
Merge branch 'tor-gitlab/mr/254' into maint-0.3.5
Diffstat (limited to 'src/feature/hs/hs_common.c')
-rw-r--r-- | src/feature/hs/hs_common.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/feature/hs/hs_common.c b/src/feature/hs/hs_common.c index ebe49f09a5..de653037d1 100644 --- a/src/feature/hs/hs_common.c +++ b/src/feature/hs/hs_common.c @@ -25,6 +25,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" @@ -272,7 +273,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(); } @@ -1098,7 +1101,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; } @@ -1343,7 +1347,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."); |