dont publish nil message removed

This commit is contained in:
whyrusleeping 2019-11-19 15:26:25 -06:00 committed by Łukasz Magiera
parent 06d498b45b
commit 71923c691d
2 changed files with 7 additions and 4 deletions

View File

@ -316,10 +316,12 @@ func (mp *MessagePool) Remove(from address.Address, nonce uint64) {
return
}
mp.changes.Pub(api.MpoolUpdate{
Type: api.MpoolRemove,
Message: mset.msgs[nonce],
}, localUpdates)
if m, ok := mset.msgs[nonce]; ok {
mp.changes.Pub(api.MpoolUpdate{
Type: api.MpoolRemove,
Message: m,
}, localUpdates)
}
// NB: This deletes any message with the given nonce. This makes sense
// as two messages with the same sender cannot have the same nonce

View File

@ -2,6 +2,7 @@ package main
import (
"context"
"github.com/filecoin-project/lotus/chain/types"
"github.com/ipfs/go-cid"