@@ -464,7 +464,7 @@ pub trait CoinSelectionSource {
464
464
/// which UTXOs to double spend is left to the implementation, but it must strive to keep the
465
465
/// set of other claims being double spent to a minimum.
466
466
fn select_confirmed_utxos (
467
- & self , claim_id : ClaimId , must_spend : & [ Input ] , must_pay_to : & [ TxOut ] ,
467
+ & self , claim_id : ClaimId , must_spend : Vec < Input > , must_pay_to : & [ TxOut ] ,
468
468
target_feerate_sat_per_1000_weight : u32 ,
469
469
) -> Result < CoinSelection , ( ) > ;
470
470
#[ cfg( not( c_bindings) ) ]
@@ -611,7 +611,7 @@ where
611
611
L :: Target : Logger
612
612
{
613
613
fn select_confirmed_utxos (
614
- & self , claim_id : ClaimId , must_spend : & [ Input ] , must_pay_to : & [ TxOut ] ,
614
+ & self , claim_id : ClaimId , must_spend : Vec < Input > , must_pay_to : & [ TxOut ] ,
615
615
target_feerate_sat_per_1000_weight : u32 ,
616
616
) -> Result < CoinSelection , ( ) > {
617
617
let utxos = self . source . list_confirmed_utxos ( ) ?;
@@ -743,7 +743,7 @@ where
743
743
satisfaction_weight: commitment_tx. weight( ) as u64 + ANCHOR_INPUT_WITNESS_WEIGHT + EMPTY_SCRIPT_SIG_WEIGHT ,
744
744
} ] ;
745
745
let coin_selection = self . utxo_source . select_confirmed_utxos (
746
- claim_id, & must_spend, & [ ] , anchor_target_feerate_sat_per_1000_weight,
746
+ claim_id, must_spend, & [ ] , anchor_target_feerate_sat_per_1000_weight,
747
747
) ?;
748
748
749
749
let mut anchor_tx = Transaction {
@@ -822,13 +822,16 @@ where
822
822
823
823
log_debug ! ( self . logger, "Peforming coin selection for HTLC transaction targeting {} sat/kW" ,
824
824
target_feerate_sat_per_1000_weight) ;
825
+ #[ cfg( debug_assertions) ]
826
+ let must_spend_satisfaction_weight =
827
+ must_spend. iter ( ) . map ( |input| input. satisfaction_weight ) . sum :: < u64 > ( ) ;
825
828
let coin_selection = self . utxo_source . select_confirmed_utxos (
826
- claim_id, & must_spend, & htlc_tx. output , target_feerate_sat_per_1000_weight,
829
+ claim_id, must_spend, & htlc_tx. output , target_feerate_sat_per_1000_weight,
827
830
) ?;
828
831
#[ cfg( debug_assertions) ]
829
832
let total_satisfaction_weight =
830
833
coin_selection. confirmed_utxos . iter ( ) . map ( |utxo| utxo. satisfaction_weight ) . sum :: < u64 > ( ) +
831
- must_spend . iter ( ) . map ( |input| input . satisfaction_weight ) . sum :: < u64 > ( ) ;
834
+ must_spend_satisfaction_weight ;
832
835
self . process_coin_selection ( & mut htlc_tx, coin_selection) ;
833
836
834
837
#[ cfg( debug_assertions) ]
0 commit comments