pub fn add_utxos(&mut self, outpoints: &[OutPoint]) -> Result<&mut Self, Error> {
        let utxos = outpoints
            .iter()
            .map(|outpoint| self.wallet.get_utxo(*outpoint)?.ok_or(Error::UnknownUtxo))
            .collect::<Result<Vec<_>, _>>()?;

        for utxo in utxos {
            let descriptor = self.wallet.get_descriptor_for_keychain(utxo.keychain);
            let satisfaction_weight = descriptor.max_satisfaction_weight().unwrap();
            self.params.utxos.push(WeightedUtxo {
                satisfaction_weight,
                utxo: Utxo::Local(utxo),
            });
        }

        Ok(self)
    }
/// Add the list of outpoints to the internal list of UTXOs that **must** be spent.
///
/// If an error occurs while adding any of the UTXOs then none of them are added and the error is returned.
///
/// These have priority over the "unspendable" utxos, meaning that if a utxo is present both in
/// the "utxos" and the "unspendable" list, it will be spent.
Add the list of outpoints to the internal list of UTXOs that **must** be spent.
If an error occurs while adding any of the UTXOs then none of them are added and the error is returned.


Add the list of outpoints to the internal list of UTXOs that ** must ** be spent . If an error occurs while adding any of the UTXOs then none of them are added and the error is returned .
pub fn add_utxos(&mut self, outpoints: &[OutPoint]) -> Result<&mut Self, Error> {
        let utxos = outpoints
            .iter()
            .map(|outpoint| self.wallet.get_utxo(*outpoint)?.ok_or(Error::UnknownUtxo))
            .collect::<Result<Vec<_>, _>>()?;
        for utxo in utxos {
            let descriptor = self.wallet.get_descriptor_for_keychain(utxo.keychain);
            let satisfaction_weight = descriptor.max_satisfaction_weight().unwrap();
            self.params.utxos.push(WeightedUtxo {
                satisfaction_weight,
                utxo: Utxo::Local(utxo),
            });
        }
        Ok(self)
    }
pub fn add_utxos ( & mut self , outpoints : & [ OutPoint ] ) -> Result < & mut Self , Error > { let utxos = outpoints . iter ( ) . map ( | outpoint | self . wallet . get_utxo ( * outpoint ) ? . ok_or ( Error :: UnknownUtxo ) ) . collect :: < Result < Vec < _ > , _ > > ( ) ? ; for utxo in utxos { let descriptor = self . wallet . get_descriptor_for_keychain ( utxo . keychain ) ; let satisfaction_weight = descriptor . max_satisfaction_weight ( ) . unwrap ( ) ; self . params . utxos . push ( WeightedUtxo { satisfaction_weight , utxo : Utxo :: Local ( utxo ) , } ) ; } Ok ( self ) }
Add the list of outpoints to the internal list of UTXOs that **must** be spent.
Add the list of outpoints to the internal list of UTXOs that ** must ** be spent .
&mut self
outpoints
&[OutPoint]
&mut self
outpoints
&[OutPoint]