eth/gasprice: fix percentile validation in eth_feeHistory

This commit is contained in:
Felix Lange 2024-02-08 11:32:18 +01:00
parent 2dc33d46b8
commit 898d1f0c67
1 changed files with 1 additions and 1 deletions

View File

@ -227,7 +227,7 @@ func (oracle *Oracle) FeeHistory(ctx context.Context, blocks uint64, unresolvedL
if p < 0 || p > 100 {
return common.Big0, nil, nil, nil, fmt.Errorf("%w: %f", errInvalidPercentile, p)
}
if i > 0 && p < rewardPercentiles[i-1] {
if i > 0 && p <= rewardPercentiles[i-1] {
return common.Big0, nil, nil, nil, fmt.Errorf("%w: #%d:%f > #%d:%f", errInvalidPercentile, i-1, rewardPercentiles[i-1], i, p)
}
}