@@ -469,7 +469,7 @@ pub trait CoinSelectionSource {
469469 ) -> Result < CoinSelection , ( ) > ;
470470 /// Signs and provides the full witness for all inputs within the transaction known to the
471471 /// trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]).
472- fn sign_tx ( & self , tx : & mut Transaction ) -> Result < ( ) , ( ) > ;
472+ fn sign_tx ( & self , tx : Transaction ) -> Result < Transaction , ( ) > ;
473473}
474474
475475/// An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to
@@ -483,7 +483,7 @@ pub trait WalletSource {
483483 /// Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within
484484 /// the transaction known to the wallet (i.e., any provided via
485485 /// [`WalletSource::list_confirmed_utxos`]).
486- fn sign_tx ( & self , tx : & mut Transaction ) -> Result < ( ) , ( ) > ;
486+ fn sign_tx ( & self , tx : Transaction ) -> Result < Transaction , ( ) > ;
487487}
488488
489489/// A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would
@@ -629,7 +629,7 @@ where
629629 . or_else ( |_| do_coin_selection ( true , true ) )
630630 }
631631
632- fn sign_tx ( & self , tx : & mut Transaction ) -> Result < ( ) , ( ) > {
632+ fn sign_tx ( & self , tx : Transaction ) -> Result < Transaction , ( ) > {
633633 self . source . sign_tx ( tx)
634634 }
635635}
@@ -748,7 +748,8 @@ where
748748 let unsigned_tx_weight = anchor_tx. weight ( ) as u64 - ( anchor_tx. input . len ( ) as u64 * EMPTY_SCRIPT_SIG_WEIGHT ) ;
749749
750750 log_debug ! ( self . logger, "Signing anchor transaction {}" , anchor_txid) ;
751- self . utxo_source . sign_tx ( & mut anchor_tx) ?;
751+ anchor_tx = self . utxo_source . sign_tx ( anchor_tx) ?;
752+
752753 let signer = anchor_descriptor. derive_channel_signer ( & self . signer_provider ) ;
753754 let anchor_sig = signer. sign_holder_anchor_input ( & anchor_tx, 0 , & self . secp ) ?;
754755 anchor_tx. input [ 0 ] . witness = anchor_descriptor. tx_input_witness ( & anchor_sig) ;
@@ -812,7 +813,8 @@ where
812813 let unsigned_tx_weight = htlc_tx. weight ( ) as u64 - ( htlc_tx. input . len ( ) as u64 * EMPTY_SCRIPT_SIG_WEIGHT ) ;
813814
814815 log_debug ! ( self . logger, "Signing HTLC transaction {}" , htlc_tx. txid( ) ) ;
815- self . utxo_source . sign_tx ( & mut htlc_tx) ?;
816+ htlc_tx = self . utxo_source . sign_tx ( htlc_tx) ?;
817+
816818 let mut signers = BTreeMap :: new ( ) ;
817819 for ( idx, htlc_descriptor) in htlc_descriptors. iter ( ) . enumerate ( ) {
818820 let signer = signers. entry ( htlc_descriptor. channel_derivation_parameters . keys_id )
0 commit comments