Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
shunjizhan committed Sep 20, 2023
1 parent 69cfc89 commit ec43786
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/eth-providers/src/base-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1776,11 +1776,11 @@ export abstract class BaseProvider extends AbstractProvider {

const filter = await this._sanitizeRawFilter(rawFilter);

// make sure subql already indexed all target blocks
const bestBlock = await this.bestBlockNumber;
const targetBlock = filter.toBlock <= bestBlock
// make sure subql already indexed all target blocks, up until the latest finalized block
const upperBoundry = await this.finalizedBlockNumber;
const targetBlock = filter.toBlock <= upperBoundry
? filter.toBlock
: bestBlock;
: upperBoundry;
let lastProcessedHeight = await this.subql.getLastProcessedHeight();
while (lastProcessedHeight < targetBlock) {
await sleep(1000);
Expand Down

0 comments on commit ec43786

Please sign in to comment.