diff --git a/core/src/stores/data_cache.rs b/core/src/stores/data_cache.rs index 6ea29e88..fbb218ee 100644 --- a/core/src/stores/data_cache.rs +++ b/core/src/stores/data_cache.rs @@ -56,11 +56,14 @@ impl DataCache { pub async fn check_if_confirmed_or_expired_blockheight( &self, sent_transaction_info: &SentTransactionInfo, - current_blockheight: u64, ) -> bool { + let last_block = self + .block_information_store + .get_latest_block_info(CommitmentConfig::processed()) + .await; self.txs .is_transaction_confirmed(&sent_transaction_info.signature) - || current_blockheight > sent_transaction_info.last_valid_block_height + || last_block.block_height > sent_transaction_info.last_valid_block_height } pub async fn get_current_epoch(&self, commitment: CommitmentConfig) -> Epoch { diff --git a/services/src/tpu_utils/tpu_connection_manager.rs b/services/src/tpu_utils/tpu_connection_manager.rs index 90e2f39f..f313c46c 100644 --- a/services/src/tpu_utils/tpu_connection_manager.rs +++ b/services/src/tpu_utils/tpu_connection_manager.rs @@ -111,7 +111,7 @@ impl ActiveConnection { let tx: Vec = match tx { Ok(transaction_sent_info) => { - if self.data_cache.txs.is_transaction_confirmed(&transaction_sent_info.signature) { + if self.data_cache.check_if_confirmed_or_expired_blockheight(&transaction_sent_info).await { // transaction is already confirmed/ no need to send continue; }