Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit ebb1105

Browse files
authored
Merge pull request #963 from iotaledger/fix/sync-status
Fix sync status
2 parents 973fe1e + eda5681 commit ebb1105

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: pkg/protocol/engine/syncmanager/trivialsyncmanager/syncmanager.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ func (s *SyncManager) updateSyncStatus() (changed bool) {
272272
s.isSyncedLock.Lock()
273273
defer s.isSyncedLock.Unlock()
274274

275-
isSynced := s.IsBootstrapped() && time.Since(s.engine.Clock.Accepted().RelativeTime()) < s.optsSyncThreshold
275+
snapshot := s.engine.Clock.Snapshot()
276+
isSynced := s.IsBootstrapped() && ((snapshot.RelativeAcceptedTime.Sub(snapshot.AcceptedTime)) < s.optsSyncThreshold)
276277
if s.isSynced != isSynced {
277278
s.isSynced = isSynced
278279

0 commit comments

Comments
 (0)