From 3d7f646ffa11e18cc1a03e258204cdf436c88d45 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Wed, 31 Aug 2022 20:29:39 +0200 Subject: [PATCH] eth/catalyst: prevent division by zero (#25654) eth/catalyst: prevent diff by zero --- eth/catalyst/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/catalyst/api.go b/eth/catalyst/api.go index 2f64e6799b7b..d3e379fc48c4 100644 --- a/eth/catalyst/api.go +++ b/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!"