Merge pull request #3387 from filecoin-project/asr/import-fix

Fix chain import
This commit is contained in:
Aayush Rajasekaran 2020-08-29 00:55:54 -04:00 committed by GitHub
commit 09a645e455
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -345,6 +345,16 @@ func ImportChain(r repo.Repo, fname string) error {
return xerrors.Errorf("importing chain failed: %w", err)
}
gb, err := cst.GetTipsetByHeight(context.TODO(), 0, ts, true)
if err != nil {
return err
}
err = cst.SetGenesis(gb.Blocks()[0])
if err != nil {
return err
}
stm := stmgr.NewStateManager(cst)
log.Infof("validating imported chain...")