/// Confirm the reception of an expected transaction output. This will be called by the Transaction Service when it
/// detects the output on the blockchain
Confirm the reception of an expected transaction output. This will be called by the Transaction Service when it
detects the output on the blockchain
Confirm the reception of an expected transaction output . This will be called by the Transaction Service when it detects the output on the blockchain
pub async fn confirm_received_transaction_output(
        &mut self,
        tx_id: u64,
        received_output: &TransactionOutput,
    ) -> Result<(), OutputManagerError>
    {
        let pending_transaction = self.resources.db.fetch_pending_transaction_outputs(tx_id).await?;
        // Assumption: We are only allowing a single output per receiver in the current transaction protocols.
        if pending_transaction.outputs_to_be_received.len() != 1 ||
            pending_transaction.outputs_to_be_received[0]
                .unblinded_output
                .as_transaction_input(&self.resources.factories.commitment, OutputFeatures::default())
                .commitment !=
                received_output.commitment
        {
            return Err(OutputManagerError::IncompleteTransaction);
        }
        self.resources
            .db
            .confirm_pending_transaction_outputs(pending_transaction.tx_id)
            .await?;
        debug!(
            target: LOG_TARGET,
            "Confirm received transaction outputs for TxId: {}", tx_id
        );
        Ok(())
    }
pub async fn confirm_received_transaction_output ( & mut self , tx_id : u64 , received_output : & TransactionOutput , ) -> Result < ( ) , OutputManagerError > { let pending_transaction = self . resources . db . fetch_pending_transaction_outputs ( tx_id ) . await ? ; // Assumption: We are only allowing a single output per receiver in the current transaction protocols. if pending_transaction . outputs_to_be_received . len ( ) != 1 || pending_transaction . outputs_to_be_received [ 0 ] . unblinded_output . as_transaction_input ( & self . resources . factories . commitment , OutputFeatures :: default ( ) ) . commitment != received_output . commitment { return Err ( OutputManagerError :: IncompleteTransaction ) ; } self . resources . db . confirm_pending_transaction_outputs ( pending_transaction . tx_id ) . await ? ; debug ! ( target LOG_TARGET " " tx_id ) ; Ok ( ( ) ) }
Confirm the reception of an expected transaction output.
Confirm the reception of an expected transaction output .
&mut self
tx_id
u64
received_output
&TransactionOutput