Skip to content

Commit

Permalink
Check rule errors when validating blocks with trusted data (kaspanet#…
Browse files Browse the repository at this point in the history
  • Loading branch information
someone235 authored Nov 21, 2022
1 parent d5c1083 commit eec6eb9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/protocol/flows/v5/blockrelay/ibd_with_headers_proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,13 @@ func (flow *handleIBDFlow) processBlockWithTrustedData(
}

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) {
Expand Down

0 comments on commit eec6eb9

Please sign in to comment.