Make consensus documents valid DistDelay seconds earlier.

This will prevent arti from hitting the same issue as
https://gitlab.torproject.org/tpo/core/tor/-/issues/25756
This commit is contained in:
Nick Mathewson 2020-09-18 19:24:06 -04:00
parent 6a2c803f98
commit 5e1e77a363
1 changed files with 4 additions and 1 deletions

View File

@ -1106,7 +1106,10 @@ impl MDConsensus {
n_authorities: None,
};
let lifetime = unval.consensus.header.hdr.lifetime.clone();
let timebound = TimerangeBound::new(unval, lifetime.valid_after..lifetime.valid_until);
let delay = unval.consensus.header.hdr.voting_delay.unwrap_or((0, 0));
let dist_interval = time::Duration::from_secs(delay.1.into());
let starting_time = lifetime.valid_after - dist_interval;
let timebound = TimerangeBound::new(unval, starting_time..lifetime.valid_until);
Ok(timebound)
}
}