Skip to content

Commit aa62ade

Browse files
authored
Merge pull request #31 from hadv/fix_inf
eth/protocols/snap: avoid estimating infinite percentage
2 parents 3ca8292 + b0d4d73 commit aa62ade

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

eth/protocols/snap/sync.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2798,6 +2798,11 @@ func (s *Syncer) reportSyncProgress(force bool) {
27982798
accountFills,
27992799
).Uint64())
28002800

2801+
// Don't report anything until we have a meaningful progress
2802+
if estBytes < 1.0 {
2803+
return
2804+
}
2805+
28012806
elapsed := time.Since(s.startTime)
28022807
estTime := elapsed / time.Duration(synced) * time.Duration(estBytes)
28032808

0 commit comments

Comments
 (0)