Skip to content

Commit 778430a

Browse files
authored
eth/filters: fix pruned history error for genesis block (#31941)
Fixes an issue where querying logs for block ranges starting from 0 would fail with an irrelevant error on a pruned node. Now the correct "history is pruned" error will be returned.
1 parent ef46417 commit 778430a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

eth/filters/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ func (api *FilterAPI) GetLogs(ctx context.Context, crit FilterCriteria) ([]*type
359359
if begin > 0 && end > 0 && begin > end {
360360
return nil, errInvalidBlockRange
361361
}
362-
if begin > 0 && begin < int64(api.events.backend.HistoryPruningCutoff()) {
362+
if begin >= 0 && begin < int64(api.events.backend.HistoryPruningCutoff()) {
363363
return nil, &history.PrunedHistoryError{}
364364
}
365365
// Construct the range filter

0 commit comments

Comments
 (0)