diff --git a/framework/src/main/java/org/tron/core/db/Manager.java b/framework/src/main/java/org/tron/core/db/Manager.java index 3fd1839f83e..764ad745d36 100644 --- a/framework/src/main/java/org/tron/core/db/Manager.java +++ b/framework/src/main/java/org/tron/core/db/Manager.java @@ -1419,29 +1419,31 @@ public TransactionInfo processTransaction(final TransactionCapsule trxCap, Block Objects.nonNull(blockCap) ? MetricLabels.BLOCK : MetricLabels.TRX, contract.getType().name()); - long start = System.currentTimeMillis(); + final long start = System.currentTimeMillis(); if (Objects.nonNull(blockCap)) { chainBaseManager.getBalanceTraceStore().initCurrentTransactionBalanceTrace(trxCap); } + if (Objects.nonNull(blockCap) && !blockCap.generatedByMyself) { + validateTapos(trxCap); + validateCommon(trxCap); + if (trxCap.getInstance().getRawData().getContractList().size() != 1) { + throw new ContractSizeNotEqualToOneException( + String.format( + "tx %s contract size should be exactly 1, this is extend feature ,actual :%d", + txId, trxCap.getInstance().getRawData().getContractList().size())); + } - validateTapos(trxCap); - validateCommon(trxCap); + validateDup(trxCap); - if (trxCap.getInstance().getRawData().getContractList().size() != 1) { - throw new ContractSizeNotEqualToOneException( - String.format( - "tx %s contract size should be exactly 1, this is extend feature ,actual :%d", - txId, trxCap.getInstance().getRawData().getContractList().size())); + if (!trxCap.validateSignature(chainBaseManager.getAccountStore(), + chainBaseManager.getDynamicPropertiesStore())) { + throw new ValidateSignatureException( + String.format(" %s transaction signature validate failed", txId)); + } } - validateDup(trxCap); - if (!trxCap.validateSignature(chainBaseManager.getAccountStore(), - chainBaseManager.getDynamicPropertiesStore())) { - throw new ValidateSignatureException( - String.format(" %s transaction signature validate failed", txId)); - } TransactionTrace trace = new TransactionTrace(trxCap, StoreFactory.getInstance(), new RuntimeImpl());