From 17cd6045410d6fa350fb55b1bc6cb54c5d52372f Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Mon, 3 Nov 2025 15:26:53 +0800 Subject: [PATCH] eth/gasprice: use `Sign()` to compare with zero, close XFN-93 (#1655) --- eth/gasprice/gasprice.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eth/gasprice/gasprice.go b/eth/gasprice/gasprice.go index 0cdffce31f..0f63c6e5b1 100644 --- a/eth/gasprice/gasprice.go +++ b/eth/gasprice/gasprice.go @@ -92,15 +92,15 @@ func NewOracle(backend OracleBackend, params Config, startPrice *big.Int) *Oracl log.Warn("Sanitizing invalid gasprice oracle sample percentile", "provided", params.Percentile, "updated", percent) } maxPrice := params.MaxPrice - if maxPrice == nil || maxPrice.Int64() <= 0 { + if maxPrice == nil || maxPrice.Sign() <= 0 { maxPrice = DefaultMaxPrice log.Warn("Sanitizing invalid gasprice oracle price cap", "provided", params.MaxPrice, "updated", maxPrice) } ignorePrice := params.IgnorePrice - if ignorePrice == nil || ignorePrice.Int64() <= 0 { + if ignorePrice == nil || ignorePrice.Sign() <= 0 { ignorePrice = DefaultIgnorePrice log.Warn("Sanitizing invalid gasprice oracle ignore price", "provided", params.IgnorePrice, "updated", ignorePrice) - } else if ignorePrice.Int64() > 0 { + } else if ignorePrice.Sign() > 0 { log.Info("Gasprice oracle is ignoring threshold set", "threshold", ignorePrice) } maxHeaderHistory := params.MaxHeaderHistory