Skip to content

Commit 320d1c7

Browse files
fjlgzliudan
authored andcommitted
eth/gasprice: fix percentile validation in eth_feeHistory (ethereum#28954)
1 parent a52efce commit 320d1c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

eth/gasprice/feehistory.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ func (oracle *Oracle) FeeHistory(ctx context.Context, blocks uint64, unresolvedL
229229
if p < 0 || p > 100 {
230230
return common.Big0, nil, nil, nil, fmt.Errorf("%w: %f", errInvalidPercentile, p)
231231
}
232-
if i > 0 && p < rewardPercentiles[i-1] {
233-
return common.Big0, nil, nil, nil, fmt.Errorf("%w: #%d:%f > #%d:%f", errInvalidPercentile, i-1, rewardPercentiles[i-1], i, p)
232+
if i > 0 && p <= rewardPercentiles[i-1] {
233+
return common.Big0, nil, nil, nil, fmt.Errorf("%w: #%d:%f >= #%d:%f", errInvalidPercentile, i-1, rewardPercentiles[i-1], i, p)
234234
}
235235
}
236236
var (

0 commit comments

Comments
 (0)