Unverified Commit 1b58e428 authored by Péter Szilágyi's avatar Péter Szilágyi Committed by GitHub

Merge pull request #24529 from holiman/fix_inf

eth/protocols/snap: avoid estimating infinite percentage
parents 7d3ecca4 65841596
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment