Skip to content

Commit 5ab683b

Browse files
committed
fix: prevent scanning future blocks
1 parent 2f7560c commit 5ab683b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/get-intervals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function (
1818
for (let i = 1; i < numRequests; i++) {
1919
intervals[i] = {
2020
fromBlock: intervals[i - 1].toBlock + 1,
21-
toBlock: intervals[i - 1].toBlock + 1 + blocksPerRequest,
21+
toBlock: Math.min(intervals[i - 1].toBlock + 1 + blocksPerRequest, currentBlock),
2222
};
2323
}
2424
return intervals;

0 commit comments

Comments
 (0)