@@ -3540,8 +3540,8 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
35403540 }
35413541 }
35423542
3543- if msg.htlc_signatures.len() != commitment_data.tx.htlcs ().len() {
3544- return Err(ChannelError::close(format!("Got wrong number of HTLC signatures ({}) from remote. It must be {}", msg.htlc_signatures.len(), commitment_data.tx.htlcs ().len())));
3543+ if msg.htlc_signatures.len() != commitment_data.tx.nondust_htlcs ().len() {
3544+ return Err(ChannelError::close(format!("Got wrong number of HTLC signatures ({}) from remote. It must be {}", msg.htlc_signatures.len(), commitment_data.tx.nondust_htlcs ().len())));
35453545 }
35463546
35473547 // Up to LDK 0.0.115, HTLC information was required to be duplicated in the
@@ -6427,7 +6427,7 @@ impl<SP: Deref> FundedChannel<SP> where
64276427 let commitment_data = self.context.build_commitment_transaction(&self.funding,
64286428 self.holder_commitment_point.transaction_number(),
64296429 &self.holder_commitment_point.current_point(), true, true, logger);
6430- let buffer_fee_msat = commit_tx_fee_sat(feerate_per_kw, commitment_data.tx.htlcs ().len() + htlc_stats.on_holder_tx_outbound_holding_cell_htlcs_count as usize + CONCURRENT_INBOUND_HTLC_FEE_BUFFER as usize, self.context.get_channel_type()) * 1000;
6430+ let buffer_fee_msat = commit_tx_fee_sat(feerate_per_kw, commitment_data.tx.nondust_htlcs ().len() + htlc_stats.on_holder_tx_outbound_holding_cell_htlcs_count as usize + CONCURRENT_INBOUND_HTLC_FEE_BUFFER as usize, self.context.get_channel_type()) * 1000;
64316431 let holder_balance_msat = commitment_data.stats.local_balance_before_fee_anchors_msat - htlc_stats.outbound_holding_cell_msat;
64326432 if holder_balance_msat < buffer_fee_msat + self.funding.counterparty_selected_channel_reserve_satoshis.unwrap() * 1000 {
64336433 //TODO: auto-close after a number of failures?
@@ -8831,7 +8831,7 @@ impl<SP: Deref> FundedChannel<SP> where
88318831 && info.next_holder_htlc_id == self.context.next_holder_htlc_id
88328832 && info.next_counterparty_htlc_id == self.context.next_counterparty_htlc_id
88338833 && info.feerate == self.context.feerate_per_kw {
8834- let actual_fee = commit_tx_fee_sat(self.context.feerate_per_kw, counterparty_commitment_tx.htlcs ().len(), self.context.get_channel_type()) * 1000;
8834+ let actual_fee = commit_tx_fee_sat(self.context.feerate_per_kw, counterparty_commitment_tx.nondust_htlcs ().len(), self.context.get_channel_type()) * 1000;
88358835 assert_eq!(actual_fee, info.fee);
88368836 }
88378837 }
@@ -8875,8 +8875,8 @@ impl<SP: Deref> FundedChannel<SP> where
88758875 log_bytes!(signature.serialize_compact()[..]), &self.context.channel_id());
88768876
88778877 let counterparty_keys = trusted_tx.keys();
8878- debug_assert_eq!(htlc_signatures.len(), trusted_tx.htlcs ().len());
8879- for (ref htlc_sig, ref htlc) in htlc_signatures.iter().zip(trusted_tx.htlcs ()) {
8878+ debug_assert_eq!(htlc_signatures.len(), trusted_tx.nondust_htlcs ().len());
8879+ for (ref htlc_sig, ref htlc) in htlc_signatures.iter().zip(trusted_tx.nondust_htlcs ()) {
88808880 log_trace!(logger, "Signed remote HTLC tx {} with redeemscript {} with pubkey {} -> {} in channel {}",
88818881 encode::serialize_hex(&chan_utils::build_htlc_transaction(&trusted_tx.txid(), trusted_tx.feerate_per_kw(), self.funding.get_holder_selected_contest_delay(), htlc, &self.context.channel_type, &counterparty_keys.broadcaster_delayed_payment_key, &counterparty_keys.revocation_key)),
88828882 encode::serialize_hex(&chan_utils::get_htlc_redeemscript(&htlc, &self.context.channel_type, &counterparty_keys)),
@@ -12003,10 +12003,10 @@ mod tests {
1200312003 counterparty_htlc_sigs.clear(); // Don't warn about excess mut for no-HTLC calls
1200412004 $({
1200512005 let remote_signature = Signature::from_der(&<Vec<u8>>::from_hex($counterparty_htlc_sig_hex).unwrap()[..]).unwrap();
12006- per_htlc.push((commitment_tx.htlcs ()[$htlc_idx].clone(), Some(remote_signature)));
12006+ per_htlc.push((commitment_tx.nondust_htlcs ()[$htlc_idx].clone(), Some(remote_signature)));
1200712007 counterparty_htlc_sigs.push(remote_signature);
1200812008 })*
12009- assert_eq!(commitment_tx.htlcs ().len(), per_htlc.len());
12009+ assert_eq!(commitment_tx.nondust_htlcs ().len(), per_htlc.len());
1201012010
1201112011 let holder_commitment_tx = HolderCommitmentTransaction::new(
1201212012 commitment_tx.clone(),
@@ -12029,7 +12029,7 @@ mod tests {
1202912029 log_trace!(logger, "verifying htlc {}", $htlc_idx);
1203012030 let remote_signature = Signature::from_der(&<Vec<u8>>::from_hex($counterparty_htlc_sig_hex).unwrap()[..]).unwrap();
1203112031
12032- let ref htlc = commitment_tx.htlcs ()[$htlc_idx];
12032+ let ref htlc = commitment_tx.nondust_htlcs ()[$htlc_idx];
1203312033 let keys = commitment_tx.trust().keys();
1203412034 let mut htlc_tx = chan_utils::build_htlc_transaction(&unsigned_tx.txid, chan.context.feerate_per_kw,
1203512035 chan.funding.get_counterparty_selected_contest_delay().unwrap(),
0 commit comments