eth/protocols/snap: avoid estimating infinite percentage

pull/24529/head
Martin Holst Swende 3 years ago
parent 538a868384
commit 658415960e
No known key found for this signature in database
GPG Key ID: 683B438C05A5DDF0
  1. 5
      eth/protocols/snap/sync.go

@ -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)

Loading…
Cancel
Save