Skip to content

Commit

Permalink
use the db store if its latter than store
Browse files Browse the repository at this point in the history
  • Loading branch information
harkamal authored and gajinder committed Oct 26, 2021
1 parent f216787 commit 5f0ca18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/cli/src/cmds/beacon/initBeaconState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function initAndVerifyWeakSubjectivityState(
if (!allForks.isWithinWeakSubjectivityPeriod(config, store, wsState, wsCheckpoint)) {
throw new Error("Fetched weak subjectivity checkpoint not within weak subjectivity period.");
}
return await initStateFromAnchorState(config, db, logger, wsState);
return await initStateFromAnchorState(config, db, logger, wsState.slot > store.slot ? wsState : store);
}

/**
Expand Down

0 comments on commit 5f0ca18

Please sign in to comment.