Skip to content

Commit

Permalink
fix: reorg detection
Browse files Browse the repository at this point in the history
  • Loading branch information
eddort committed Dec 20, 2023
1 parent 3fa909b commit 138e9c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/jobs/keys-update/keys-update.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export class KeysUpdateService {

if (currentBlock.parentHash === prevBlock.hash) return false;
// TODO: different hash but same number
if (currentBlock.number === prevBlock.number) return true;
// if (currentBlock.number === prevBlock.number) return true;

const blocks = await Promise.all(
range(prevBlock.number, currentBlock.number).map(async (bNumber) => {
Expand All @@ -264,11 +264,11 @@ export class KeysUpdateService {
const currentBlock = blocks[i];

if (currentBlock.parentHash !== previousBlock.hash) {
return false;
return true;
}
}

return true;
return false;
}

public isTooMuchDiffBetweenBlocks(prevBlockNumber: number, currentBlockNumber: number) {
Expand Down

0 comments on commit 138e9c3

Please sign in to comment.