eth/catalyst: prevent division by zero (#25654)

eth/catalyst: prevent diff by zero
pull/25642/head
Marius van der Wijden 2 years ago committed by GitHub
parent 3f79afb599
commit 95a2c221d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      eth/catalyst/api.go

@ -656,7 +656,7 @@ func (api *ConsensusAPI) heartbeat() {
if deltaTime > 0 {
growth := deltaDiff / deltaTime
left := new(big.Int).Sub(ttd, htd)
eta = time.Duration(new(big.Int).Div(left, new(big.Int).SetUint64(growth)).Uint64()) * time.Second
eta = time.Duration(new(big.Int).Div(left, new(big.Int).SetUint64(growth+1)).Uint64()) * time.Second
}
}
message := "Merge is configured, but previously seen beacon client is offline. Please ensure it is operational before the transition arrives!"

Loading…
Cancel
Save