eth/gasprice: sanitize startPrice

This commit is contained in:
Marius van der Wijden 2024-07-19 13:26:30 +02:00
parent 6adf7b9089
commit 3c876456e6

View file

@ -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)