Skip to content

Commit

Permalink
fix: genesis has height 0, so properly detect the first block
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Apr 13, 2021
1 parent 7e228d4 commit 5b524da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/cosmic-swingset/lib/launch-chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ export async function launch(
}

const [savedHeight, savedActions, savedChainSends] = JSON.parse(
storage.get(SWING_STORE_META_KEY) || '[0, [], []]',
storage.get(SWING_STORE_META_KEY) || '[-1, [], []]',
);
firstBlock = savedHeight === 0;
firstBlock = savedHeight < 0;

return {
deliverInbound,
Expand Down

0 comments on commit 5b524da

Please sign in to comment.