diff --git a/ledger/src/contains.rs b/ledger/src/contains.rs index d7d5310c87..64a52bbda5 100644 --- a/ledger/src/contains.rs +++ b/ledger/src/contains.rs @@ -58,10 +58,7 @@ impl> Ledger { /// Returns `true` if the given transaction ID exists. pub fn contains_transaction_id(&self, transaction_id: &N::TransactionID) -> Result { - self.vm - .transaction_store() - .contains_transaction_id(transaction_id) - .or(self.vm.block_store().contains_rejected_or_aborted_transaction_id(transaction_id)) + self.vm.block_store().contains_transaction_id(transaction_id) } /* Transition */ diff --git a/ledger/store/src/block/mod.rs b/ledger/store/src/block/mod.rs index f44dd30f14..335b934526 100644 --- a/ledger/store/src/block/mod.rs +++ b/ledger/store/src/block/mod.rs @@ -1238,6 +1238,12 @@ impl> BlockStore { self.storage.reverse_id_map().contains_key_confirmed(block_hash) } + /// Returns `true` if the given transaction ID exists. + pub fn contains_transaction_id(&self, transaction_id: &N::TransactionID) -> Result { + Ok(self.transaction_store().contains_transaction_id(transaction_id)? + || self.contains_rejected_or_aborted_transaction_id(transaction_id)?) + } + /// Returns `true` if the given rejected or aborted transaction ID exists. pub fn contains_rejected_or_aborted_transaction_id(&self, transaction_id: &N::TransactionID) -> Result { self.storage.rejected_or_aborted_transaction_id_map().contains_key_confirmed(transaction_id) diff --git a/synthesizer/src/vm/verify.rs b/synthesizer/src/vm/verify.rs index 2a40dfbdb4..d94be9addc 100644 --- a/synthesizer/src/vm/verify.rs +++ b/synthesizer/src/vm/verify.rs @@ -40,9 +40,7 @@ impl> VM { /* Transaction */ // Ensure the transaction ID is unique. - if self.transaction_store().contains_transaction_id(&transaction.id())? - || self.block_store().contains_rejected_or_aborted_transaction_id(&transaction.id())? - { + if self.block_store().contains_transaction_id(&transaction.id())? { bail!("Transaction '{}' already exists in the ledger", transaction.id()) }