From 658415960ee342c69bc0b04cecd4c490de2b3b63 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Thu, 10 Mar 2022 12:46:48 +0100 Subject: [PATCH] eth/protocols/snap: avoid estimating infinite percentage --- eth/protocols/snap/sync.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eth/protocols/snap/sync.go b/eth/protocols/snap/sync.go index d4e7f1676..0f2d0aba6 100644 --- a/eth/protocols/snap/sync.go +++ b/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)