@@ -1421,7 +1421,7 @@ pub struct CommitmentTransaction {
14211421 to_countersignatory_value_sat : Amount ,
14221422 to_broadcaster_delay : Option < u16 > , // Added in 0.0.117
14231423 feerate_per_kw : u32 ,
1424- htlcs : Vec < HTLCOutputInCommitment > ,
1424+ nondust_htlcs : Vec < HTLCOutputInCommitment > ,
14251425 // Note that on upgrades, some features of existing outputs may be missed.
14261426 channel_type_features : ChannelTypeFeatures ,
14271427 // A cache of the parties' pubkeys required to construct the transaction, see doc for trust()
@@ -1437,7 +1437,7 @@ impl PartialEq for CommitmentTransaction {
14371437 self . to_broadcaster_value_sat == o. to_broadcaster_value_sat &&
14381438 self . to_countersignatory_value_sat == o. to_countersignatory_value_sat &&
14391439 self . feerate_per_kw == o. feerate_per_kw &&
1440- self . htlcs == o. htlcs &&
1440+ self . nondust_htlcs == o. nondust_htlcs &&
14411441 self . channel_type_features == o. channel_type_features &&
14421442 self . keys == o. keys ;
14431443 if eq {
@@ -1459,7 +1459,7 @@ impl Writeable for CommitmentTransaction {
14591459 ( 6 , self . feerate_per_kw, required) ,
14601460 ( 8 , self . keys, required) ,
14611461 ( 10 , self . built, required) ,
1462- ( 12 , self . htlcs , required_vec) ,
1462+ ( 12 , self . nondust_htlcs , required_vec) ,
14631463 ( 14 , legacy_deserialization_prevention_marker, option) ,
14641464 ( 15 , self . channel_type_features, required) ,
14651465 } ) ;
@@ -1477,7 +1477,7 @@ impl Readable for CommitmentTransaction {
14771477 ( 6 , feerate_per_kw, required) ,
14781478 ( 8 , keys, required) ,
14791479 ( 10 , built, required) ,
1480- ( 12 , htlcs , required_vec) ,
1480+ ( 12 , nondust_htlcs , required_vec) ,
14811481 ( 14 , _legacy_deserialization_prevention_marker, ( option, explicit_type: ( ) ) ) ,
14821482 ( 15 , channel_type_features, option) ,
14831483 } ) ;
@@ -1494,7 +1494,7 @@ impl Readable for CommitmentTransaction {
14941494 feerate_per_kw : feerate_per_kw. 0 . unwrap ( ) ,
14951495 keys : keys. 0 . unwrap ( ) ,
14961496 built : built. 0 . unwrap ( ) ,
1497- htlcs ,
1497+ nondust_htlcs ,
14981498 channel_type_features : channel_type_features. unwrap_or ( ChannelTypeFeatures :: only_static_remote_key ( ) )
14991499 } )
15001500 }
@@ -1517,7 +1517,7 @@ impl CommitmentTransaction {
15171517 let keys = TxCreationKeys :: from_channel_static_keys ( per_commitment_point, channel_parameters. broadcaster_pubkeys ( ) , channel_parameters. countersignatory_pubkeys ( ) , secp_ctx) ;
15181518
15191519 // Sort outputs and populate output indices while keeping track of the auxiliary data
1520- let ( outputs, htlcs ) = Self :: internal_build_outputs ( & keys, to_broadcaster_value_sat, to_countersignatory_value_sat, htlcs_with_aux, channel_parameters) ;
1520+ let ( outputs, nondust_htlcs ) = Self :: internal_build_outputs ( & keys, to_broadcaster_value_sat, to_countersignatory_value_sat, htlcs_with_aux, channel_parameters) ;
15211521
15221522 let ( obscured_commitment_transaction_number, txins) = Self :: internal_build_inputs ( commitment_number, channel_parameters) ;
15231523 let transaction = Self :: make_transaction ( obscured_commitment_transaction_number, txins, outputs) ;
@@ -1528,7 +1528,7 @@ impl CommitmentTransaction {
15281528 to_countersignatory_value_sat,
15291529 to_broadcaster_delay : Some ( channel_parameters. contest_delay ( ) ) ,
15301530 feerate_per_kw,
1531- htlcs ,
1531+ nondust_htlcs ,
15321532 channel_type_features : channel_parameters. channel_type_features ( ) . clone ( ) ,
15331533 keys,
15341534 built : BuiltCommitmentTransaction {
@@ -1549,7 +1549,7 @@ impl CommitmentTransaction {
15491549 fn internal_rebuild_transaction ( & self , keys : & TxCreationKeys , channel_parameters : & DirectedChannelTransactionParameters ) -> BuiltCommitmentTransaction {
15501550 let ( obscured_commitment_transaction_number, txins) = Self :: internal_build_inputs ( self . commitment_number , channel_parameters) ;
15511551
1552- let mut htlcs_with_aux = self . htlcs . iter ( ) . map ( |h| ( h. clone ( ) , ( ) ) ) . collect ( ) ;
1552+ let mut htlcs_with_aux = self . nondust_htlcs . iter ( ) . map ( |h| ( h. clone ( ) , ( ) ) ) . collect ( ) ;
15531553 let ( outputs, _) = Self :: internal_build_outputs ( keys, self . to_broadcaster_value_sat , self . to_countersignatory_value_sat , & mut htlcs_with_aux, channel_parameters) ;
15541554
15551555 let transaction = Self :: make_transaction ( obscured_commitment_transaction_number, txins, outputs) ;
@@ -1637,7 +1637,7 @@ impl CommitmentTransaction {
16371637 }
16381638 }
16391639
1640- let mut htlcs = Vec :: with_capacity ( htlcs_with_aux. len ( ) ) ;
1640+ let mut nondust_htlcs = Vec :: with_capacity ( htlcs_with_aux. len ( ) ) ;
16411641 for ( htlc, _) in htlcs_with_aux {
16421642 let script = get_htlc_redeemscript ( htlc, channel_type, keys) ;
16431643 let txout = TxOut {
@@ -1667,11 +1667,11 @@ impl CommitmentTransaction {
16671667 for ( idx, out) in txouts. drain ( ..) . enumerate ( ) {
16681668 if let Some ( htlc) = out. 1 {
16691669 htlc. transaction_output_index = Some ( idx as u32 ) ;
1670- htlcs . push ( htlc. clone ( ) ) ;
1670+ nondust_htlcs . push ( htlc. clone ( ) ) ;
16711671 }
16721672 outputs. push ( out. 0 ) ;
16731673 }
1674- ( outputs, htlcs )
1674+ ( outputs, nondust_htlcs )
16751675 }
16761676
16771677 fn internal_build_inputs ( commitment_number : u64 , channel_parameters : & DirectedChannelTransactionParameters ) -> ( u64 , Vec < TxIn > ) {
@@ -1730,8 +1730,8 @@ impl CommitmentTransaction {
17301730 ///
17311731 /// This is not exported to bindings users as we cannot currently convert Vec references to/from C, though we should
17321732 /// expose a less effecient version which creates a Vec of references in the future.
1733- pub fn htlcs ( & self ) -> & Vec < HTLCOutputInCommitment > {
1734- & self . htlcs
1733+ pub fn nondust_htlcs ( & self ) -> & Vec < HTLCOutputInCommitment > {
1734+ & self . nondust_htlcs
17351735 }
17361736
17371737 /// Trust our pre-built transaction and derived transaction creation public keys.
@@ -1815,10 +1815,10 @@ impl<'a> TrustedCommitmentTransaction<'a> {
18151815 let inner = self . inner ;
18161816 let keys = & inner. keys ;
18171817 let txid = inner. built . txid ;
1818- let mut ret = Vec :: with_capacity ( inner. htlcs . len ( ) ) ;
1818+ let mut ret = Vec :: with_capacity ( inner. nondust_htlcs . len ( ) ) ;
18191819 let holder_htlc_key = derive_private_key ( secp_ctx, & inner. keys . per_commitment_point , htlc_base_key) ;
18201820
1821- for this_htlc in inner. htlcs . iter ( ) {
1821+ for this_htlc in inner. nondust_htlcs . iter ( ) {
18221822 assert ! ( this_htlc. transaction_output_index. is_some( ) ) ;
18231823 let htlc_tx = build_htlc_transaction ( & txid, inner. feerate_per_kw , channel_parameters. contest_delay ( ) , & this_htlc, & self . channel_type_features , & keys. broadcaster_delayed_payment_key , & keys. revocation_key ) ;
18241824
@@ -1836,7 +1836,7 @@ impl<'a> TrustedCommitmentTransaction<'a> {
18361836 preimage : & Option < PaymentPreimage > ,
18371837 ) -> Transaction {
18381838 let keys = & self . inner . keys ;
1839- let this_htlc = & self . inner . htlcs [ htlc_index] ;
1839+ let this_htlc = & self . inner . nondust_htlcs [ htlc_index] ;
18401840 assert ! ( this_htlc. transaction_output_index. is_some( ) ) ;
18411841 // if we don't have preimage for an HTLC-Success, we can't generate an HTLC transaction.
18421842 if !this_htlc. offered && preimage. is_none ( ) { unreachable ! ( ) ; }
@@ -1858,7 +1858,7 @@ impl<'a> TrustedCommitmentTransaction<'a> {
18581858 ) -> Witness {
18591859 let keys = & self . inner . keys ;
18601860 let htlc_redeemscript = get_htlc_redeemscript_with_explicit_keys (
1861- & self . inner . htlcs [ htlc_index] , & self . channel_type_features , & keys. broadcaster_htlc_key ,
1861+ & self . inner . nondust_htlcs [ htlc_index] , & self . channel_type_features , & keys. broadcaster_htlc_key ,
18621862 & keys. countersignatory_htlc_key , & keys. revocation_key
18631863 ) ;
18641864 build_htlc_input_witness (
0 commit comments