From 5f0ca184fbd47971ffb332e12e05bc4b5e4ba571 Mon Sep 17 00:00:00 2001 From: harkamal Date: Tue, 26 Oct 2021 12:43:50 +0530 Subject: [PATCH] use the db store if its latter than store --- packages/cli/src/cmds/beacon/initBeaconState.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/src/cmds/beacon/initBeaconState.ts b/packages/cli/src/cmds/beacon/initBeaconState.ts index 0d2cebd85afa..c4b036508d39 100644 --- a/packages/cli/src/cmds/beacon/initBeaconState.ts +++ b/packages/cli/src/cmds/beacon/initBeaconState.ts @@ -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); } /**