From aacfcba40067f7c1a70e19f05b90baf422b7eafc Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Tue, 25 Aug 2020 01:01:16 +0200 Subject: [PATCH] Check ValidForBlockInclusion in mpool Signed-off-by: Jakub Sztandera --- chain/messagepool/messagepool.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chain/messagepool/messagepool.go b/chain/messagepool/messagepool.go index 644a9104f..5816bae28 100644 --- a/chain/messagepool/messagepool.go +++ b/chain/messagepool/messagepool.go @@ -317,6 +317,10 @@ func (mp *MessagePool) checkMessage(m *types.SignedMessage) error { return xerrors.Errorf("mpool message too large (%dB): %w", m.Size(), ErrMessageTooBig) } + if err := m.Message.ValidForBlockInclusion(0); err != nil { + return xerrors.Errorf("message not valid for block inclusion: %d", err) + } + if m.Message.To == address.Undef { return ErrInvalidToAddr }