rename messagepool ProtectMessages to ForEachPendingMessage

This commit is contained in:
vyzo 2021-07-20 09:23:36 +03:00
parent c47fce8d2d
commit 839b00ab40
2 changed files with 4 additions and 4 deletions

View File

@ -426,18 +426,18 @@ func New(api Provider, ds dtypes.MetadataDS, netName dtypes.NetworkName, j journ
return mp, nil
}
func (mp *MessagePool) ProtectMessages(protect func(cid.Cid) error) error {
func (mp *MessagePool) ForEachPendingMessage(f func(cid.Cid) error) error {
mp.lk.Lock()
defer mp.lk.Unlock()
for _, mset := range mp.pending {
for _, m := range mset.msgs {
err := protect(m.Cid())
err := f(m.Cid())
if err != nil {
return err
}
err = protect(m.Message.Cid())
err = f(m.Message.Cid())
if err != nil {
return err
}

View File

@ -68,7 +68,7 @@ func MessagePool(lc fx.Lifecycle, mpp messagepool.Provider, ds dtypes.MetadataDS
return mp.Close()
},
})
protector.AddProtector(mp.ProtectMessages)
protector.AddProtector(mp.ForEachPendingMessage)
return mp, nil
}