Skip to content

Commit becca46

Browse files
eth/protocols/snap: fix negative eta in state progress logging (#32225)
1 parent f36d349 commit becca46

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

eth/protocols/snap/sync.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3111,6 +3111,10 @@ func (s *Syncer) reportSyncProgress(force bool) {
31113111
if estBytes < 1.0 {
31123112
return
31133113
}
3114+
// Cap the estimated state size using the synced size to avoid negative values
3115+
if estBytes < float64(synced) {
3116+
estBytes = float64(synced)
3117+
}
31143118
elapsed := time.Since(s.startTime)
31153119
estTime := elapsed / time.Duration(synced) * time.Duration(estBytes)
31163120

0 commit comments

Comments
 (0)