pub fn cpfp_txin(&self, cpfp_descriptor: &DerivedCpfpDescriptor) -> CpfpTxIn {
        let spk = cpfp_descriptor.inner().script_pubkey();
        let index = self
            .psbt()
            .global
            .unsigned_tx
            .output
            .iter()
            .position(|txo| txo.script_pubkey == spk)
            .expect("We always create UnvaultTransaction with a CPFP output");

        // Unwraped above
        let txo = &self.psbt().global.unsigned_tx.output[index];
        let prev_txout = CpfpTxOut::new(Amount::from_sat(txo.value), cpfp_descriptor);
        CpfpTxIn::new(
            OutPoint {
                txid: self.psbt().global.unsigned_tx.txid(),
                vout: index.try_into().expect("There are two outputs"),
            },
            prev_txout,
        )
    }
/// Get the CPFP txo to be referenced in a spending transaction
Get the CPFP txo to be referenced in a spending transaction
Get the CPFP txo to be referenced in a spending transaction
pub fn cpfp_txin(&self, cpfp_descriptor: &DerivedCpfpDescriptor) -> CpfpTxIn {
        let spk = cpfp_descriptor.inner().script_pubkey();
        let index = self
            .psbt()
            .global
            .unsigned_tx
            .output
            .iter()
            .position(|txo| txo.script_pubkey == spk)
            .expect("We always create UnvaultTransaction with a CPFP output");
        // Unwraped above
        let txo = &self.psbt().global.unsigned_tx.output[index];
        let prev_txout = CpfpTxOut::new(Amount::from_sat(txo.value), cpfp_descriptor);
        CpfpTxIn::new(
            OutPoint {
                txid: self.psbt().global.unsigned_tx.txid(),
                vout: index.try_into().expect("There are two outputs"),
            },
            prev_txout,
        )
    }
pub fn cpfp_txin ( & self , cpfp_descriptor : & DerivedCpfpDescriptor ) -> CpfpTxIn { let spk = cpfp_descriptor . inner ( ) . script_pubkey ( ) ; let index = self . psbt ( ) . global . unsigned_tx . output . iter ( ) . position ( | txo | txo . script_pubkey == spk ) . expect ( " " ) ; // Unwraped above let txo = & self . psbt ( ) . global . unsigned_tx . output [ index ] ; let prev_txout = CpfpTxOut :: new ( Amount :: from_sat ( txo . value ) , cpfp_descriptor ) ; CpfpTxIn :: new ( OutPoint { txid : self . psbt ( ) . global . unsigned_tx . txid ( ) , vout : index . try_into ( ) . expect ( " " ) , } , prev_txout , ) }
Get the CPFP txo to be referenced in a spending transaction
Get the CPFP txo to be referenced in a spending transaction
&self
cpfp_descriptor
&DerivedCpfpDescriptor