hotfix migration

should have just kept the full copy-pasted dbseq init
This commit is contained in:
Jacek Sieka 2021-05-26 09:56:21 +02:00
parent 80ed54378c
commit 18d26071d8
No known key found for this signature in database
GPG Key ID: A1B09461ABB656B8
1 changed files with 2 additions and 2 deletions

View File

@ -259,13 +259,13 @@ proc loadImmutableValidators(db: BeaconChainDB): seq[ImmutableValidatorData] =
proc copyDbSeq[T](db0, db: SqStoreRef, name: string) = proc copyDbSeq[T](db0, db: SqStoreRef, name: string) =
var var
src = DbSeq[T].init(db0, "genesis_deposits") src = DbSeq[T].init(db0, name)
if src.isErr(): if src.isErr():
debug "Skipping migration", name, msg = src.error() debug "Skipping migration", name, msg = src.error()
return return
var tgt = DbSeq[T].init(db, "genesis_deposits").expectDb() var tgt = DbSeq[T].init(db, name).expectDb()
while tgt.len < src.get().len(): while tgt.len < src.get().len():
tgt.add src.get().get(tgt.len()) tgt.add src.get().get(tgt.len())