check message before adding in PushWithNonce

This commit is contained in:
vyzo 2020-08-26 14:13:46 +03:00
parent da9630c561
commit 835dbfe001

View File

@ -333,7 +333,7 @@ func (mp *MessagePool) checkMessage(m *types.SignedMessage) error {
}
if err := mp.VerifyMsgSig(m); err != nil {
log.Warnf("mpooladd signature verification failed: %s", err)
log.Warnf("signature verification failed: %s", err)
return err
}
@ -558,6 +558,11 @@ func (mp *MessagePool) PushWithNonce(ctx context.Context, addr address.Address,
return nil, err
}
err = mp.checkMessage(msg)
if err != nil {
return nil, err
}
// reacquire the locks and check state for consistency
mp.curTsLk.Lock()
defer mp.curTsLk.Unlock()