Skip to content

Commit 6584159

Browse files
committed
eth/protocols/snap: avoid estimating infinite percentage
1 parent 538a868 commit 6584159

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

eth/protocols/snap/sync.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2826,7 +2826,10 @@ func (s *Syncer) reportSyncProgress(force bool) {
28262826
new(big.Int).Mul(new(big.Int).SetUint64(uint64(synced)), hashSpace),
28272827
accountFills,
28282828
).Uint64())
2829-
2829+
// Don't report anything until we have a meaningful progress
2830+
if estBytes < 1.0 {
2831+
return
2832+
}
28302833
elapsed := time.Since(s.startTime)
28312834
estTime := elapsed / time.Duration(synced) * time.Duration(estBytes)
28322835

0 commit comments

Comments
 (0)