fix chain progression after restarting process

This commit is contained in:
whyrusleeping
2019-08-01 23:46:14 -07:00
parent b26f1d5b24
commit ff3433baa1
2 changed files with 7 additions and 14 deletions
+3 -5
View File
@@ -55,11 +55,9 @@ func ChainBlockservice(bs dtypes.ChainBlockstore, rem dtypes.ChainExchange) dtyp
func ChainStore(lc fx.Lifecycle, bs dtypes.ChainBlockstore, ds dtypes.MetadataDS) *store.ChainStore {
chain := store.NewChainStore(bs, ds)
lc.Append(fx.Hook{
OnStart: func(ctx context.Context) error {
return chain.Load()
},
})
if err := chain.Load(); err != nil {
log.Warnf("loading chain state from disk: %s", err)
}
return chain
}