From 95a2c221d4c780346cf8766d1b416a8147d17e39 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 19dd28e64..5ab61524a 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!"