mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
eth/protocols/snap: fix negative eta in state progress logging (#32225)
This commit is contained in:
parent
f36d349918
commit
becca46010
1 changed files with 4 additions and 0 deletions
|
|
@ -3111,6 +3111,10 @@ func (s *Syncer) reportSyncProgress(force bool) {
|
|||
if estBytes < 1.0 {
|
||||
return
|
||||
}
|
||||
// Cap the estimated state size using the synced size to avoid negative values
|
||||
if estBytes < float64(synced) {
|
||||
estBytes = float64(synced)
|
||||
}
|
||||
elapsed := time.Since(s.startTime)
|
||||
estTime := elapsed / time.Duration(synced) * time.Duration(estBytes)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue