From 5b8f33390c2dbc7735cd46ab20e11eb9f9016fa7 Mon Sep 17 00:00:00 2001 From: Janito Vaqueiro Ferreira Filho Date: Mon, 24 May 2021 21:59:09 -0300 Subject: [PATCH] Add comment to describe purpose Make it clear why all peers have the time offset applied to them. Co-authored-by: teor --- zebra-network/src/peer_set/candidate_set.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/zebra-network/src/peer_set/candidate_set.rs b/zebra-network/src/peer_set/candidate_set.rs index fcf1ee9a..c7e8498e 100644 --- a/zebra-network/src/peer_set/candidate_set.rs +++ b/zebra-network/src/peer_set/candidate_set.rs @@ -372,6 +372,7 @@ fn limit_last_seen_times(addrs: &mut Vec, last_seen_limit: DateTime32) .max() .expect("unexpected empty address list"); + // If any time is in the future, adjust all times, to compensate for clock skew on honest peers if most_recent_reported_seen_timestamp > last_seen_limit.timestamp() { let offset = most_recent_reported_seen_timestamp - last_seen_limit.timestamp();