aboutsummaryrefslogtreecommitdiff
path: root/src/feature/nodelist/microdesc.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-01-09 09:33:31 -0500
committerNick Mathewson <nickm@torproject.org>2019-01-09 09:33:31 -0500
commit3df1d29d9b5ccb3b49760105ca7fd434e22d3924 (patch)
treeb0e06eda9e1f0c70b672159aea460065caffb660 /src/feature/nodelist/microdesc.c
parente6a44012001afb2d4c5956e4b55ccf6b622fd79e (diff)
parent44db455cc894b4a0fda80a28ed5ea55bf4d41231 (diff)
downloadtor-3df1d29d9b5ccb3b49760105ca7fd434e22d3924.tar.gz
tor-3df1d29d9b5ccb3b49760105ca7fd434e22d3924.zip
Merge branch 'bug28591_035_squashed'
Diffstat (limited to 'src/feature/nodelist/microdesc.c')
-rw-r--r--src/feature/nodelist/microdesc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/feature/nodelist/microdesc.c b/src/feature/nodelist/microdesc.c
index eadca69548..82070afb98 100644
--- a/src/feature/nodelist/microdesc.c
+++ b/src/feature/nodelist/microdesc.c
@@ -111,8 +111,9 @@ microdesc_note_outdated_dirserver(const char *relay_digest)
/* If we have a reasonably live consensus, then most of our dirservers should
* still be caching all the microdescriptors in it. Reasonably live
- * consensuses are up to a day old. But microdescriptors expire 7 days after
- * the last consensus that referenced them. */
+ * consensuses are up to a day old (or a day in the future). But
+ * microdescriptors expire 7 days after the last consensus that referenced
+ * them. */
if (!networkstatus_get_reasonably_live_consensus(approx_time(),
FLAV_MICRODESC)) {
return;
@@ -545,8 +546,8 @@ microdesc_cache_clean(microdesc_cache_t *cache, time_t cutoff, int force)
size_t bytes_dropped = 0;
time_t now = time(NULL);
- /* If we don't know a live consensus, don't believe last_listed values: we
- * might be starting up after being down for a while. */
+ /* If we don't know a reasonably live consensus, don't believe last_listed
+ * values: we might be starting up after being down for a while. */
if (! force &&
! networkstatus_get_reasonably_live_consensus(now, FLAV_MICRODESC))
return;
@@ -971,6 +972,7 @@ update_microdesc_downloads(time_t now)
if (directory_too_idle_to_fetch_descriptors(options, now))
return;
+ /* Give up if we don't have a reasonably live consensus. */
consensus = networkstatus_get_reasonably_live_consensus(now, FLAV_MICRODESC);
if (!consensus)
return;