Merge pull request #3274 from filecoin-project/fix/check-message-valid

Check ValidForBlockInclusion in mpool
This commit is contained in:
Łukasz Magiera 2020-08-25 01:08:02 +02:00 committed by GitHub
commit d789ca9299
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}