This commit is contained in:
rayoo 2026-06-18 21:54:36 -07:00 committed by GitHub
commit 58fc0ab061
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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