Skip to content

Commit ae3b7a0

Browse files
authored
eth/gasprice: fix percentile validation in eth_feeHistory (#28954)
1 parent 2dc33d4 commit ae3b7a0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

eth/gasprice/feehistory.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ func (oracle *Oracle) FeeHistory(ctx context.Context, blocks uint64, unresolvedL
227227
if p < 0 || p > 100 {
228228
return common.Big0, nil, nil, nil, fmt.Errorf("%w: %f", errInvalidPercentile, p)
229229
}
230-
if i > 0 && p < rewardPercentiles[i-1] {
231-
return common.Big0, nil, nil, nil, fmt.Errorf("%w: #%d:%f > #%d:%f", errInvalidPercentile, i-1, rewardPercentiles[i-1], i, p)
230+
if i > 0 && p <= rewardPercentiles[i-1] {
231+
return common.Big0, nil, nil, nil, fmt.Errorf("%w: #%d:%f >= #%d:%f", errInvalidPercentile, i-1, rewardPercentiles[i-1], i, p)
232232
}
233233
}
234234
var (

0 commit comments

Comments
 (0)