diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/or/main.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/or/main.c b/src/or/main.c index 17ee14651f..2daf8aefef 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -818,6 +818,7 @@ run_scheduled_events(time_t now) static time_t time_to_save_stability = 0; static time_t time_to_clean_caches = 0; static time_t time_to_recheck_bandwidth = 0; + static time_t time_to_check_for_expired_networkstatus = 0; or_options_t *options = get_options(); int i; int have_dir_info; @@ -932,6 +933,22 @@ run_scheduled_events(time_t now) time_to_check_v3_certificate = now + CHECK_V3_CERTIFICATE_INTERVAL; } + /* 1f. Check whether our networkstatus has expired. + */ + if (time_to_check_for_expired_networkstatus < now) { + networkstatus_vote_t *ns = networkstatus_get_latest_consensus(); + /*XXXX020 this value needs to be the same as REASONABLY_LIVE_TIME in + * networkstatus_get_reasonably_live_consensus(), but that value is way + * way too high. Arma: is the bridge issue there resolved yet? -NM */ +#define NS_EXPIRY_SLOP (24*60*60) + if (ns && ns->valid_until < now+NS_EXPIRY_SLOP && + router_have_minimum_dir_info()) { + router_dir_info_changed(); + } +#define CHECK_EXPIRED_NS_INTERVAL (2*60) + time_to_check_for_expired_networkstatus = now + CHECK_EXPIRED_NS_INTERVAL; + } + /** 2. Periodically, we consider getting a new directory, getting a * new running-routers list, and/or force-uploading our descriptor * (if we've passed our internal checks). */ |