diff --git a/chain/messagepool.go b/chain/messagepool.go index aa01024c7..57053c966 100644 --- a/chain/messagepool.go +++ b/chain/messagepool.go @@ -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 diff --git a/cmd/lotus-chainwatch/blockssub.go b/cmd/lotus-chainwatch/blockssub.go index 9f76a0315..9c5957f67 100644 --- a/cmd/lotus-chainwatch/blockssub.go +++ b/cmd/lotus-chainwatch/blockssub.go @@ -2,6 +2,7 @@ package main import ( "context" + "github.com/filecoin-project/lotus/chain/types" "github.com/ipfs/go-cid"