@@ -876,15 +876,15 @@ where
876876 // add witness_utxo to anchor input
877877 anchor_psbt. inputs [ 0 ] . witness_utxo = Some ( anchor_descriptor. previous_utxo ( ) ) ;
878878 // add witness_utxo to remaining inputs
879- for ( idx, ConfirmedUtxo { utxo, .. } ) in coin_selection. confirmed_utxos . into_iter ( ) . enumerate ( ) {
879+ for ( idx, utxo) in coin_selection. confirmed_utxos . into_iter ( ) . enumerate ( ) {
880880 // add 1 to skip the anchor input
881881 let index = idx + 1 ;
882882 debug_assert_eq ! (
883883 anchor_psbt. unsigned_tx. input[ index] . previous_output,
884- utxo. outpoint
884+ utxo. outpoint( )
885885 ) ;
886- if utxo. output . script_pubkey . is_witness_program ( ) {
887- anchor_psbt. inputs [ index] . witness_utxo = Some ( utxo. output ) ;
886+ if utxo. output ( ) . script_pubkey . is_witness_program ( ) {
887+ anchor_psbt. inputs [ index] . witness_utxo = Some ( utxo. into_output ( ) ) ;
888888 }
889889 }
890890
@@ -1138,12 +1138,15 @@ where
11381138 }
11391139
11401140 // add witness_utxo to remaining inputs
1141- for ( idx, ConfirmedUtxo { utxo, .. } ) in coin_selection. confirmed_utxos . into_iter ( ) . enumerate ( ) {
1141+ for ( idx, utxo) in coin_selection. confirmed_utxos . into_iter ( ) . enumerate ( ) {
11421142 // offset to skip the htlc inputs
11431143 let index = idx + selected_htlcs. len ( ) ;
1144- debug_assert_eq ! ( htlc_psbt. unsigned_tx. input[ index] . previous_output, utxo. outpoint) ;
1145- if utxo. output . script_pubkey . is_witness_program ( ) {
1146- htlc_psbt. inputs [ index] . witness_utxo = Some ( utxo. output ) ;
1144+ debug_assert_eq ! (
1145+ htlc_psbt. unsigned_tx. input[ index] . previous_output,
1146+ utxo. outpoint( )
1147+ ) ;
1148+ if utxo. output ( ) . script_pubkey . is_witness_program ( ) {
1149+ htlc_psbt. inputs [ index] . witness_utxo = Some ( utxo. into_output ( ) ) ;
11471150 }
11481151 }
11491152
@@ -1353,10 +1356,7 @@ mod tests {
13531356 version : Version :: TWO ,
13541357 lock_time : LockTime :: ZERO ,
13551358 input : vec ! [ ] ,
1356- output : vec ! [ TxOut {
1357- value: Amount :: from_sat( 200 ) ,
1358- script_pubkey: ScriptBuf :: new( )
1359- } ] ,
1359+ output : vec ! [ TxOut { value: Amount :: from_sat( 200 ) , script_pubkey: ScriptBuf :: new( ) } ] ,
13601360 } ;
13611361
13621362 let broadcaster = TestBroadcaster :: new ( Network :: Testnet ) ;
0 commit comments