Skip to content

Commit

Permalink
Merge pull request #3387 from filecoin-project/asr/import-fix
Browse files Browse the repository at this point in the history
Fix chain import
  • Loading branch information
arajasek committed Aug 29, 2020
2 parents d972a47 + 5095e6f commit 09a645e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/lotus/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...")
Expand Down

0 comments on commit 09a645e

Please sign in to comment.