From be4effdd8b762c315d5c3b324ea670d2afcfbf68 Mon Sep 17 00:00:00 2001 From: SW van Heerden Date: Wed, 7 Aug 2024 16:53:17 +0200 Subject: [PATCH] check encumbrance --- .../wallet/src/transaction_service/service.rs | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/base_layer/wallet/src/transaction_service/service.rs b/base_layer/wallet/src/transaction_service/service.rs index f55825672f..05a9199674 100644 --- a/base_layer/wallet/src/transaction_service/service.rs +++ b/base_layer/wallet/src/transaction_service/service.rs @@ -1686,12 +1686,6 @@ where .await .map_err(|e| TransactionServiceProtocolError::new(tx_id, e.into()))?; - self.resources - .output_manager_service - .confirm_pending_transaction(tx_id) - .await - .map_err(|e| TransactionServiceProtocolError::new(tx_id, e.into()))?; - // Prepare receiver part of the transaction // Diffie-Hellman shared secret `k_Ob * K_Sb = K_Ob * k_Sb` results in a public key, which is fed into @@ -1832,6 +1826,12 @@ where let fee = stp .get_fee_amount() .map_err(|e| TransactionServiceProtocolError::new(tx_id, e.into()))?; + + self.resources + .output_manager_service + .confirm_pending_transaction(tx_id) + .await + .map_err(|e| TransactionServiceProtocolError::new(tx_id, e.into()))?; self.submit_transaction( transaction_broadcast_join_handles, CompletedTransaction::new( @@ -1940,11 +1940,6 @@ where .await .map_err(|e| TransactionServiceProtocolError::new(tx_id, e.into()))?; - self.resources - .output_manager_service - .confirm_pending_transaction(tx_id) - .await - .map_err(|e| TransactionServiceProtocolError::new(tx_id, e.into()))?; let sender_message = TransactionSenderMessage::new_single_round_message( stp.get_single_round_message(&self.resources.transaction_key_manager_service) .await?, @@ -2091,6 +2086,12 @@ where let fee = stp .get_fee_amount() .map_err(|e| TransactionServiceProtocolError::new(tx_id, e.into()))?; + + self.resources + .output_manager_service + .confirm_pending_transaction(tx_id) + .await + .map_err(|e| TransactionServiceProtocolError::new(tx_id, e.into()))?; self.submit_transaction( transaction_broadcast_join_handles, CompletedTransaction::new(