udp: network: update ValidUntil structs less often

This commit is contained in:
Joakim Frostegård 2021-11-19 01:18:58 +01:00
parent 9c919a6ecb
commit a530dc2860
2 changed files with 16 additions and 3 deletions

View file

@ -23,6 +23,9 @@ impl ValidUntil {
pub fn new(offset_seconds: u64) -> Self {
Self(Instant::now() + Duration::from_secs(offset_seconds))
}
pub fn new_with_now(now: Instant, offset_seconds: u64) -> Self {
Self(now + Duration::from_secs(offset_seconds))
}
}
/// Extract response peers