You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lightning/src/ln/channel.rs
+6-12
Original file line number
Diff line number
Diff line change
@@ -878,9 +878,7 @@ struct HTLCStats {
878
878
/// An enum gathering stats on commitment transaction, either local or remote.
879
879
struct CommitmentStats<'a> {
880
880
tx: CommitmentTransaction, // the transaction info
881
-
feerate_per_kw: u32, // the feerate included to build the transaction
882
881
total_fee_sat: u64, // the total fee included in the transaction
883
-
num_nondust_htlcs: usize, // the number of HTLC outputs (dust HTLCs *non*-included)
884
882
htlcs_included: Vec<(HTLCOutputInCommitment, Option<&'a HTLCSource>)>, // the list of HTLCs (dust HTLCs *included*) which were not ignored when building the transaction
885
883
local_balance_msat: u64, // local balance before fees *not* considering dust limits
@@ -5488,8 +5482,8 @@ impl<SP: Deref> FundedChannel<SP> where
5488
5482
}
5489
5483
}
5490
5484
5491
-
if msg.htlc_signatures.len() != commitment_stats.num_nondust_htlcs {
5492
-
return Err(ChannelError::close(format!("Got wrong number of HTLC signatures ({}) from remote. It must be {}", msg.htlc_signatures.len(), commitment_stats.num_nondust_htlcs)));
5485
+
if msg.htlc_signatures.len() != commitment_stats.tx.htlcs().len() {
5486
+
return Err(ChannelError::close(format!("Got wrong number of HTLC signatures ({}) from remote. It must be {}", msg.htlc_signatures.len(), commitment_stats.tx.htlcs().len())));
5493
5487
}
5494
5488
5495
5489
// Up to LDK 0.0.115, HTLC information was required to be duplicated in the
@@ -5512,7 +5506,7 @@ impl<SP: Deref> FundedChannel<SP> where
5512
5506
let holder_keys = TxCreationKeys::from_channel_static_keys(&self.holder_commitment_point.current_point(), self.context.get_holder_pubkeys(), self.context.get_counterparty_pubkeys(), &self.context.secp_ctx);
5513
5507
for (idx, (htlc, mut source_opt)) in htlcs_cloned.drain(..).enumerate() {
5514
5508
if let Some(_) = htlc.transaction_output_index {
5515
-
let htlc_tx = chan_utils::build_htlc_transaction(&commitment_txid, commitment_stats.feerate_per_kw,
5509
+
let htlc_tx = chan_utils::build_htlc_transaction(&commitment_txid, commitment_stats.tx.feerate_per_kw(),
0 commit comments