Skip to content

Commit

Permalink
Merge pull request #434 from EYBlockchain/david/fix-state-sync
Browse files Browse the repository at this point in the history
fix: corrected empty blockchain check
  • Loading branch information
Westlad authored Jan 27, 2022
2 parents b169a3b + 9ea90be commit 62ca1d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nightfall-optimist/src/services/state-sync.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default async proposer => {
const lastBlockNumberL2 = Number(
(await stateContractInstance.methods.getNumberOfL2Blocks().call()) - 1,
);
if (lastBlockNumberL2 === 0) return; // The blockchain is empty
if (lastBlockNumberL2 === -1) return; // The blockchain is empty

const missingBlocks = await checkBlocks(); // Stores any gaps of missing blocks
// const [fromBlock] = missingBlocks[0];
Expand Down

0 comments on commit 62ca1d3

Please sign in to comment.