Skip to content

Commit

Permalink
eth/catalyst: prevent division by zero (ethereum#25654)
Browse files Browse the repository at this point in the history
eth/catalyst: prevent diff by zero
  • Loading branch information
MariusVanDerWijden authored and HanWang233 committed Sep 11, 2022
1 parent aa5cb48 commit 27a2a6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eth/catalyst/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand Down

0 comments on commit 27a2a6f

Please sign in to comment.