Skip to content

Commit

Permalink
fix: Now toBlockNumber is changed to take difference in case of 0 o…
Browse files Browse the repository at this point in the history
…r less number in `mirai_web3`
  • Loading branch information
i-asimkhan committed Feb 28, 2024
1 parent 5bcd1e1 commit 6d4fb35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/mirai_web3/lib/services/web_modal_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ class Web3ModalService {
const int difference = 50000;
// Based on the `offset` it is decided that from where the search should start
int toBlockNumber = currentBlockNumber - (difference * offset);
toBlockNumber = (toBlockNumber < 0) ? 0 : difference;
toBlockNumber = (toBlockNumber < 0) ? difference : toBlockNumber;
// starting from the 50,000 blocks beg=hind the `toBlock`
int fromBlockNumber = toBlockNumber - difference;
fromBlockNumber = (fromBlockNumber < 0) ? 0 : fromBlockNumber;
Expand Down

0 comments on commit 6d4fb35

Please sign in to comment.