Check rule errors when validating blocks with trusted data (#2171)

This commit is contained in:
Ori Newman 2022-11-21 23:06:00 +02:00 committed by GitHub
parent d5c10832c2
commit eec6eb9669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -286,7 +286,13 @@ func (flow *handleIBDFlow) processBlockWithTrustedData(
} }
err := consensus.ValidateAndInsertBlockWithTrustedData(blockWithTrustedData, false) err := consensus.ValidateAndInsertBlockWithTrustedData(blockWithTrustedData, false)
return err if err != nil {
if errors.As(err, &ruleerrors.RuleError{}) {
return protocolerrors.Wrapf(true, err, "failed validating block with trusted data")
}
return err
}
return nil
} }
func (flow *handleIBDFlow) receiveBlockWithTrustedData() (*appmessage.MsgBlockWithTrustedDataV4, bool, error) { func (flow *handleIBDFlow) receiveBlockWithTrustedData() (*appmessage.MsgBlockWithTrustedDataV4, bool, error) {