@@ -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
/// Signs and provides the full witness for all inputs within the transaction known to the
@@ -600,7 +600,7 @@ where
600
600
L :: Target : Logger
601
601
{
602
602
fn select_confirmed_utxos (
603
- & self , claim_id : ClaimId , must_spend : & [ Input ] , must_pay_to : & [ TxOut ] ,
603
+ & self , claim_id : ClaimId , must_spend : Vec < Input > , must_pay_to : & [ TxOut ] ,
604
604
target_feerate_sat_per_1000_weight : u32 ,
605
605
) -> Result < CoinSelection , ( ) > {
606
606
let utxos = self . source . list_confirmed_utxos ( ) ?;
@@ -726,7 +726,7 @@ where
726
726
satisfaction_weight: commitment_tx. weight( ) as u64 + ANCHOR_INPUT_WITNESS_WEIGHT + EMPTY_SCRIPT_SIG_WEIGHT ,
727
727
} ] ;
728
728
let coin_selection = self . utxo_source . select_confirmed_utxos (
729
- claim_id, & must_spend, & [ ] , anchor_target_feerate_sat_per_1000_weight,
729
+ claim_id, must_spend, & [ ] , anchor_target_feerate_sat_per_1000_weight,
730
730
) ?;
731
731
732
732
let mut anchor_tx = Transaction {
@@ -800,13 +800,16 @@ where
800
800
801
801
log_debug ! ( self . logger, "Peforming coin selection for HTLC transaction targeting {} sat/kW" ,
802
802
target_feerate_sat_per_1000_weight) ;
803
+ #[ cfg( debug_assertions) ]
804
+ let must_spend_satisfaction_weight =
805
+ must_spend. iter ( ) . map ( |input| input. satisfaction_weight ) . sum :: < u64 > ( ) ;
803
806
let coin_selection = self . utxo_source . select_confirmed_utxos (
804
- claim_id, & must_spend, & htlc_tx. output , target_feerate_sat_per_1000_weight,
807
+ claim_id, must_spend, & htlc_tx. output , target_feerate_sat_per_1000_weight,
805
808
) ?;
806
809
#[ cfg( debug_assertions) ]
807
810
let total_satisfaction_weight =
808
811
coin_selection. confirmed_utxos . iter ( ) . map ( |utxo| utxo. satisfaction_weight ) . sum :: < u64 > ( ) +
809
- must_spend . iter ( ) . map ( |input| input . satisfaction_weight ) . sum :: < u64 > ( ) ;
812
+ must_spend_satisfaction_weight ;
810
813
self . process_coin_selection ( & mut htlc_tx, coin_selection) ;
811
814
812
815
#[ cfg( debug_assertions) ]
0 commit comments