Skip to content

Commit

Permalink
fix blockLogsMode blocksDiff on node start
Browse files Browse the repository at this point in the history
  • Loading branch information
defi-dev committed Aug 7, 2024
1 parent e413c1a commit ccf58a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ export class Network {
this._walkThroughTheJobs(block.number, block.timestamp);

if (this.contractEventsEmitter.blockLogsMode) {
const blocksDiff = blockNumber - oldLatestBlockNumber;
const blocksDiff = oldLatestBlockNumber ? blockNumber - oldLatestBlockNumber : 0n;
const fromBlock = bigintToHex(blocksDiff > 1n ? oldLatestBlockNumber + 1n : blockNumber);
const toBlock = bigintToHex(blockNumber);
this.contractEventsEmitter.emitByBlockQuery({ fromBlock, toBlock });
Expand Down

0 comments on commit ccf58a3

Please sign in to comment.