Skip to content

Commit ed51166

Browse files
committed
eth/filters: check in rpc level
Signed-off-by: jsvisa <[email protected]>
1 parent aac7d4e commit ed51166

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

eth/filters/api.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,9 @@ func (api *FilterAPI) GetLogs(ctx context.Context, crit FilterCriteria) ([]*type
348348
if crit.ToBlock != nil {
349349
end = crit.ToBlock.Int64()
350350
}
351+
if begin > 0 && end > 0 && begin > end {
352+
return nil, errInvalidBlockRange
353+
}
351354
// Construct the range filter
352355
filter = api.sys.NewRangeFilter(begin, end, crit.Addresses, crit.Topics)
353356
}

0 commit comments

Comments
 (0)