No need to check AT transactions in Block.areTransactionsValid()

This commit is contained in:
catbref 2020-04-16 13:16:30 +01:00
parent 8dbd8c4e65
commit 33010f82d8

View File

@ -1026,6 +1026,10 @@ public class Block {
for (Transaction transaction : this.getTransactions()) {
TransactionData transactionData = transaction.getTransactionData();
// Skip AT transactions as they are covered by prior call to Block.areAtsValid()
if (transactionData.getType() == TransactionType.AT)
continue;
// GenesisTransactions are not allowed (GenesisBlock overrides isValid() to allow them)
if (transactionData.getType() == TransactionType.GENESIS || transactionData.getType() == TransactionType.ACCOUNT_FLAGS)
return ValidationResult.GENESIS_TRANSACTIONS_INVALID;