Compare commits

...
2 Commits
Author SHA1 Message Date
vyzo 4c71182c6b Merge pull request #3280 from filecoin-project/fix/mpool-init-crash
initialize mpool ts _before_ loading local messages
2020-08-25 09:04:11 +03:00
vyzo 7e81081899 initialize mpool ts _before_ loading local messages 2020-08-25 08:49:15 +03:00
+7 -6
View File
@@ -190,12 +190,7 @@ func New(api Provider, ds dtypes.MetadataDS, netName dtypes.NetworkName) (*Messa
// enable initial prunes
mp.pruneCooldown <- struct{}{}
if err := mp.loadLocal(); err != nil {
log.Errorf("loading local messages: %+v", err)
}
go mp.runLoop()
// load the current tipset and subscribe to head changes _before_ loading local messages
mp.curTs = api.SubscribeHeadChanges(func(rev, app []*types.TipSet) error {
err := mp.HeadChange(rev, app)
if err != nil {
@@ -204,6 +199,12 @@ func New(api Provider, ds dtypes.MetadataDS, netName dtypes.NetworkName) (*Messa
return err
})
if err := mp.loadLocal(); err != nil {
log.Errorf("loading local messages: %+v", err)
}
go mp.runLoop()
return mp, nil
}