From eda5681821e0346a5c00c6651dfa79e1cab26e93 Mon Sep 17 00:00:00 2001 From: muXxer Date: Tue, 7 May 2024 15:50:12 +0200 Subject: [PATCH] Fix sync status --- .../engine/syncmanager/trivialsyncmanager/syncmanager.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/protocol/engine/syncmanager/trivialsyncmanager/syncmanager.go b/pkg/protocol/engine/syncmanager/trivialsyncmanager/syncmanager.go index 85c625f48..ca17d7ad0 100644 --- a/pkg/protocol/engine/syncmanager/trivialsyncmanager/syncmanager.go +++ b/pkg/protocol/engine/syncmanager/trivialsyncmanager/syncmanager.go @@ -272,7 +272,8 @@ func (s *SyncManager) updateSyncStatus() (changed bool) { s.isSyncedLock.Lock() defer s.isSyncedLock.Unlock() - isSynced := s.IsBootstrapped() && time.Since(s.engine.Clock.Accepted().RelativeTime()) < s.optsSyncThreshold + snapshot := s.engine.Clock.Snapshot() + isSynced := s.IsBootstrapped() && ((snapshot.RelativeAcceptedTime.Sub(snapshot.AcceptedTime)) < s.optsSyncThreshold) if s.isSynced != isSynced { s.isSynced = isSynced