mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-18 13:59:26 +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 {
|
if estBytes < 1.0 {
|
||||||
return
|
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)
|
elapsed := time.Since(s.startTime)
|
||||||
estTime := elapsed / time.Duration(synced) * time.Duration(estBytes)
|
estTime := elapsed / time.Duration(synced) * time.Duration(estBytes)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue