mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
Update sync.go
This commit is contained in:
parent
4217f3e043
commit
2f1dfac198
1 changed files with 5 additions and 1 deletions
|
|
@ -3108,9 +3108,13 @@ func (s *Syncer) reportSyncProgress(force bool) {
|
||||||
accountFills,
|
accountFills,
|
||||||
).Uint64())
|
).Uint64())
|
||||||
// Don't report anything until we have a meaningful progress
|
// Don't report anything until we have a meaningful progress
|
||||||
if estBytes < 1.0 || float64(synced) > estBytes {
|
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