put correct sync committee branch version into DB
This commit is contained in:
parent
c0d07e1b24
commit
e7349be3e5
|
@ -329,8 +329,7 @@ proc getCurrentSyncCommitteeBranch*[T: ForkyCurrentSyncCommitteeBranch](
|
|||
func putCurrentSyncCommitteeBranch*[T: ForkyCurrentSyncCommitteeBranch](
|
||||
db: LightClientDataDB, slot: Slot, branch: T) =
|
||||
doAssert not db.backend.readOnly # All `stmt` are non-nil
|
||||
if not slot.isSupportedBySQLite or
|
||||
distinctBase(db.currentBranches[T.kind].getStmt) == nil:
|
||||
if not slot.isSupportedBySQLite:
|
||||
return
|
||||
let res = db.currentBranches[T.kind].putStmt.exec(
|
||||
(slot.int64, SSZ.encode(branch)))
|
||||
|
|
|
@ -723,9 +723,11 @@ proc createLightClientBootstrap(
|
|||
const lcDataFork = lcDataForkAtConsensusFork(consensusFork)
|
||||
dag.lcDataStore.db.putHeader(
|
||||
forkyBlck.toLightClientHeader(lcDataFork))
|
||||
else: raiseAssert "Unreachable"
|
||||
dag.lcDataStore.db.putCurrentSyncCommitteeBranch(
|
||||
bid.slot, dag.getLightClientData(bid).current_sync_committee_branch)
|
||||
bid.slot, normalize_merkle_branch(
|
||||
dag.getLightClientData(bid).current_sync_committee_branch,
|
||||
lcDataFork.CURRENT_SYNC_COMMITTEE_GINDEX))
|
||||
else: raiseAssert "Unreachable"
|
||||
ok()
|
||||
|
||||
proc initLightClientDataCache*(dag: ChainDAGRef) =
|
||||
|
|
Loading…
Reference in New Issue