Skip to content

Commit

Permalink
Merge pull request #46 from AbdulAhadArain/develop
Browse files Browse the repository at this point in the history
added default startblock
  • Loading branch information
AbdulAhadArain authored Oct 2, 2024
2 parents aa16ff1 + 427f22a commit 49db930
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/crons/nodeSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const nodeSyncJob = async () => {
const provider = new ethers.providers.JsonRpcProvider(rpc);
const currentBlock = await provider.getBlockNumber();
const lastVisitedBlock = await blockService.getLastBlockNumber();
await nodeService.processBlockAndTransaction(lastVisitedBlock, currentBlock);
await nodeService.processBlockAndTransaction(
lastVisitedBlock ? lastVisitedBlock : currentBlock - 10000,
currentBlock,
);
};
export default nodeSyncJob;

0 comments on commit 49db930

Please sign in to comment.