Skip to content

Commit

Permalink
Merge pull request #24529 from holiman/fix_inf
Browse files Browse the repository at this point in the history
eth/protocols/snap: avoid estimating infinite percentage
  • Loading branch information
karalabe committed Mar 11, 2022
2 parents 7d3ecca + 6584159 commit 1b58e42
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion eth/protocols/snap/sync.go
Expand Up @@ -2826,7 +2826,10 @@ func (s *Syncer) reportSyncProgress(force bool) {
new(big.Int).Mul(new(big.Int).SetUint64(uint64(synced)), hashSpace),
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 1b58e42

Please sign in to comment.