From 3c876456e63130af7b90acd31844ab732db3eecb Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Fri, 19 Jul 2024 13:26:30 +0200 Subject: [PATCH] eth/gasprice: sanitize startPrice --- eth/gasprice/gasprice.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eth/gasprice/gasprice.go b/eth/gasprice/gasprice.go index 3c87c445e6..19a6c0010a 100644 --- a/eth/gasprice/gasprice.go +++ b/eth/gasprice/gasprice.go @@ -114,6 +114,9 @@ func NewOracle(backend OracleBackend, params Config, startPrice *big.Int) *Oracl maxBlockHistory = 1 log.Warn("Sanitizing invalid gasprice oracle max block history", "provided", params.MaxBlockHistory, "updated", maxBlockHistory) } + if startPrice == nil { + startPrice = new(big.Int) + } cache := lru.NewCache[cacheKey, processedFees](2048) headEvent := make(chan core.ChainHeadEvent, 1)