diff --git a/eth/filters/api.go b/eth/filters/api.go index f4bed35b26..60abb22f5b 100644 --- a/eth/filters/api.go +++ b/eth/filters/api.go @@ -532,6 +532,9 @@ func (api *FilterAPI) GetFilterLogs(ctx context.Context, id rpc.ID) ([]*types.Lo if f.crit.ToBlock != nil { end = f.crit.ToBlock.Int64() } + if begin >= 0 && begin < int64(api.events.backend.HistoryPruningCutoff()) { + return nil, &history.PrunedHistoryError{} + } // Construct the range filter filter = api.sys.NewRangeFilter(begin, end, f.crit.Addresses, f.crit.Topics, api.rangeLimit) }