From 5012da11ab9181379ab759d6d2d7066c647bfc04 Mon Sep 17 00:00:00 2001 From: David Venhoek Date: Thu, 27 Jun 2024 09:17:25 +0200 Subject: [PATCH] Bug fix for failing to update last_iter --- ntp-proto/src/algorithm/kalman/source.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ntp-proto/src/algorithm/kalman/source.rs b/ntp-proto/src/algorithm/kalman/source.rs index b5e1ca756..5891e7a37 100644 --- a/ntp-proto/src/algorithm/kalman/source.rs +++ b/ntp-proto/src/algorithm/kalman/source.rs @@ -437,13 +437,16 @@ impl SourceFilter { return false; } + // This was a valid measurement, so no matter what this represents our current itertation time + // for the purposes of synchronizing + self.last_iter = measurement.localtime; + // Filter out one-time outliers (based on delay!) if !self.prev_was_outlier && (measurement.delay.to_seconds() - self.roundtriptime_stats.mean()) > algo_config.delay_outlier_threshold * self.roundtriptime_stats.variance().sqrt() { self.prev_was_outlier = true; - self.last_iter = measurement.localtime; return false; }