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:
parent
6a2c803f98
commit
5e1e77a363
|
@ -1106,7 +1106,10 @@ impl MDConsensus {
|
||||||
n_authorities: None,
|
n_authorities: None,
|
||||||
};
|
};
|
||||||
let lifetime = unval.consensus.header.hdr.lifetime.clone();
|
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)
|
Ok(timebound)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue