Skip to content

Commit 1b271b3

Browse files
authored
Merge pull request #1840 from tronprotocol/impl_getunchecked_transactionStore
impl getunchecked
2 parents b3f6c54 + 028184c commit 1b271b3

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/main/java/org/tron/core/db/Manager.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,7 @@ void validateCommon(TransactionCapsule transactionCapsule)
594594
}
595595

596596
void validateDup(TransactionCapsule transactionCapsule) throws DupTransactionException {
597-
if (getTransactionStore().getUnchecked(transactionCapsule.getTransactionId().getBytes())
598-
!= null) {
597+
if (getTransactionStore().has(transactionCapsule.getTransactionId().getBytes())) {
599598
logger.debug(ByteArray.toHexString(transactionCapsule.getTransactionId().getBytes()));
600599
throw new DupTransactionException("dup trans");
601600
}

src/main/java/org/tron/core/db/TransactionStore.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ public TransactionCapsule get(byte[] key) throws BadItemException {
8686
return transactionCapsule == null ? new TransactionCapsule(value) : transactionCapsule;
8787
}
8888

89+
@Override
90+
public TransactionCapsule getUnchecked(byte[] key) {
91+
try {
92+
return get(key);
93+
} catch (Exception e) {
94+
return null;
95+
}
96+
}
97+
8998
/**
9099
* get total transaction.
91100
*/

0 commit comments

Comments
 (0)