Skip to content

Commit

Permalink
Merge pull request ethereum#31 from hadv/fix_inf
Browse files Browse the repository at this point in the history
eth/protocols/snap: avoid estimating infinite percentage
  • Loading branch information
quan8 authored Jun 9, 2022
2 parents 3ca8292 + b0d4d73 commit aa62ade
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions eth/protocols/snap/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -2798,6 +2798,11 @@ func (s *Syncer) reportSyncProgress(force bool) {
accountFills,
).Uint64())

// Don't report anything until we have a meaningful progress
if estBytes < 1.0 {
return
}

elapsed := time.Since(s.startTime)
estTime := elapsed / time.Duration(synced) * time.Duration(estBytes)

Expand Down

0 comments on commit aa62ade

Please sign in to comment.