chg: fix percentile validation in fee history (#1235)

This commit is contained in:
Marcello Ardizzone 2024-05-01 15:30:15 +02:00 committed by Pratik Patil
parent 5b0805d706
commit 57b77e3b6c
No known key found for this signature in database
GPG key ID: AFDCA496554874B3

View file

@ -244,8 +244,8 @@ func (oracle *Oracle) FeeHistory(ctx context.Context, blocks uint64, unresolvedL
return common.Big0, nil, nil, nil, fmt.Errorf("%w: %f", errInvalidPercentile, p)
}
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)
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)
}
}