clocksync: Don't update prev_est on min rtt updates

Average frequency changes over the longer interval on a sample that
causes a minimum rtt update.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-09-28 01:09:18 -04:00
parent ba837c2641
commit 6f65ba9214
1 changed files with 2 additions and 1 deletions

View File

@ -83,6 +83,7 @@ class ClockSync:
clock_fast = False clock_fast = False
new_time = sent_time + self.min_half_rtt new_time = sent_time + self.min_half_rtt
if clock_fast != self.last_clock_fast: if clock_fast != self.last_clock_fast:
if sent_time > self.min_half_rtt_time:
self.prev_est = self.clock_est self.prev_est = self.clock_est
self.last_clock_fast = clock_fast self.last_clock_fast = clock_fast
new_freq = (clock - self.prev_est[1]) / (new_time - self.prev_est[0]) new_freq = (clock - self.prev_est[1]) / (new_time - self.prev_est[0])