Skip to content

Commit

Permalink
fix: in sync
Browse files Browse the repository at this point in the history
  • Loading branch information
mfw78 committed Oct 18, 2023
1 parent e20efc5 commit 7766934
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/domain/chainContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ export class ChainContext {
toBlock =
toBlock > currentBlock.number ? currentBlock.number : toBlock;

// This happens when the watch-tower has restarted and the last processed block is
// the current block. Therefore the `fromBlock` is the current block + 1, which is
// greater than the current block number. In this case, we are in sync.
if (fromBlock > currentBlock.number) {
this.sync = ChainSync.IN_SYNC;
break;
}

log.debug(
`Reaching tip of chain, current block number: ${currentBlock.number}`
);
Expand Down

0 comments on commit 7766934

Please sign in to comment.