eth/filters: reject GetLogs range with begin > 0 and end == 0

This commit is contained in:
rayoo 2026-05-29 15:18:15 +08:00
parent 0ef867b292
commit 0c392b78cf

View file

@ -478,7 +478,7 @@ func (api *FilterAPI) GetLogs(ctx context.Context, crit FilterCriteria) ([]*type
end = crit.ToBlock.Int64()
}
// Block numbers below 0 are special cases.
if begin > 0 && end > 0 && begin > end {
if begin >= 0 && end >= 0 && begin > end {
return nil, errInvalidBlockRange
}
if begin >= 0 && begin < int64(api.events.backend.HistoryPruningCutoff()) {