initialize mpool ts _before_ loading local messages
This commit is contained in:
parent
a085b3b5f3
commit
7e81081899
@ -190,12 +190,7 @@ func New(api Provider, ds dtypes.MetadataDS, netName dtypes.NetworkName) (*Messa
|
|||||||
// enable initial prunes
|
// enable initial prunes
|
||||||
mp.pruneCooldown <- struct{}{}
|
mp.pruneCooldown <- struct{}{}
|
||||||
|
|
||||||
if err := mp.loadLocal(); err != nil {
|
// load the current tipset and subscribe to head changes _before_ loading local messages
|
||||||
log.Errorf("loading local messages: %+v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
go mp.runLoop()
|
|
||||||
|
|
||||||
mp.curTs = api.SubscribeHeadChanges(func(rev, app []*types.TipSet) error {
|
mp.curTs = api.SubscribeHeadChanges(func(rev, app []*types.TipSet) error {
|
||||||
err := mp.HeadChange(rev, app)
|
err := mp.HeadChange(rev, app)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -204,6 +199,12 @@ func New(api Provider, ds dtypes.MetadataDS, netName dtypes.NetworkName) (*Messa
|
|||||||
return err
|
return err
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if err := mp.loadLocal(); err != nil {
|
||||||
|
log.Errorf("loading local messages: %+v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
go mp.runLoop()
|
||||||
|
|
||||||
return mp, nil
|
return mp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user