Skip to content

Commit

Permalink
(BIDS-2634) fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
remoterami committed Dec 19, 2023
1 parent 8c68196 commit 552fabe
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions db/bigtable_eth1.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,13 @@ func (bigtable *Bigtable) GetBlocksDescending(start, limit uint64) ([]*types.Eth
})
defer tmr.Stop()

if start < 1 || limit < 1 {
return nil, fmt.Errorf("invalid block range provided (start: %v, limit: %v)", start, limit)
if limit == 0 {
return nil, fmt.Errorf("error limit is set to 0 which would not fetch any blocks")
}

if limit > start {
limit = start
// clamp limit
if limit > start+1 {
limit = start + 1
}

startPadded := reversedPaddedBlockNumber(start)
Expand Down

0 comments on commit 552fabe

Please sign in to comment.