core: adjust verifyTxAttributes for HighPriority attributes

The fact that they have hight priority does not mean that cheks for other
attributes should be skipped.
This commit is contained in:
Anna Shaleva 2020-11-20 13:30:27 +03:00
parent 8cdf2d3464
commit fc9f0034c9

View file

@ -1328,12 +1328,9 @@ func (bc *Blockchain) verifyTxAttributes(tx *transaction.Transaction) error {
switch attrType := tx.Attributes[i].Type; attrType {
case transaction.HighPriority:
h := bc.contracts.NEO.GetCommitteeAddress()
for i := range tx.Signers {
if tx.Signers[i].Account.Equals(h) {
return nil
}
if !tx.HasSigner(h) {
return fmt.Errorf("%w: high priority tx is not signed by committee", ErrInvalidAttribute)
}
return fmt.Errorf("%w: high priority tx is not signed by committee", ErrInvalidAttribute)
case transaction.OracleResponseT:
h, err := bc.contracts.Oracle.GetScriptHash(bc.dao)
if err != nil || h.Equals(util.Uint160{}) {