rename messagepool ProtectMessages to ForEachPendingMessage
This commit is contained in:
parent
c47fce8d2d
commit
839b00ab40
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user