diff --git a/applications/minotari_console_wallet/src/grpc/wallet_grpc_server.rs b/applications/minotari_console_wallet/src/grpc/wallet_grpc_server.rs index 19b8dd8b82..718dd6addd 100644 --- a/applications/minotari_console_wallet/src/grpc/wallet_grpc_server.rs +++ b/applications/minotari_console_wallet/src/grpc/wallet_grpc_server.rs @@ -1088,15 +1088,17 @@ async fn handle_pending_outbound( transaction_service: &mut TransactionServiceHandle, sender: &mut Sender>, ) { - match transaction_service.get_pending_outbound_transactions().await { - Ok(txs) => { - if let Some(tx) = txs.iter().find(|tx| tx.tx_id == tx_id) { + use models::WalletTransaction::PendingOutbound; + match transaction_service.get_any_transaction(tx_id).await { + Ok(tx) => match tx { + Some(PendingOutbound(tx)) => { let transaction_event = convert_to_transaction_event(event.to_string(), TransactionWrapper::Outbound(Box::new(tx.clone()))); send_transaction_event(transaction_event, sender).await; - } else { + }, + _ => { error!(target: LOG_TARGET, "Not found in pending outbound set tx_id: {}", tx_id); - } + }, }, Err(e) => error!(target: LOG_TARGET, "Transaction service error: {}", e), } diff --git a/applications/minotari_console_wallet/src/ui/state/app_state.rs b/applications/minotari_console_wallet/src/ui/state/app_state.rs index db9406c2a7..1373e29087 100644 --- a/applications/minotari_console_wallet/src/ui/state/app_state.rs +++ b/applications/minotari_console_wallet/src/ui/state/app_state.rs @@ -734,7 +734,6 @@ impl AppStateInner { .map(|t| CompletedTransaction::from(t.clone())) .collect::>(), ); - // Question(C): We sort txs by mined_timestamp in sql, here is by timestamp pending_transactions.sort_by(|a: &CompletedTransaction, b: &CompletedTransaction| { b.timestamp.partial_cmp(&a.timestamp).unwrap() }); @@ -755,7 +754,6 @@ impl AppStateInner { .get_cancelled_completed_transactions() .await?, ); - // Question(C): We sort txs by mined_timestamp in sql, here is by timestamp completed_transactions.sort_by(|a, b| { b.timestamp .partial_cmp(&a.timestamp) diff --git a/base_layer/wallet/src/transaction_service/storage/sqlite_db.rs b/base_layer/wallet/src/transaction_service/storage/sqlite_db.rs index d3ebd0659f..ce1744473a 100644 --- a/base_layer/wallet/src/transaction_service/storage/sqlite_db.rs +++ b/base_layer/wallet/src/transaction_service/storage/sqlite_db.rs @@ -1173,7 +1173,6 @@ impl InboundTransactionSql { ) -> Result, TransactionStorageError> { Ok(inbound_transactions::table .filter(inbound_transactions::cancelled.eq(i32::from(cancelled))) - // QUESTION(A): Should we order by timestamp or last_send_timestamp? .order_by(inbound_transactions::timestamp.desc()) .load::(conn)?) } @@ -1439,7 +1438,6 @@ impl OutboundTransactionSql { ) -> Result, TransactionStorageError> { Ok(outbound_transactions::table .filter(outbound_transactions::cancelled.eq(i32::from(cancelled))) - // QUESTION(A): Should we order by timestamp or last_send_timestamp? .order_by(outbound_transactions::timestamp.desc()) .load::(conn)?) }