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
The fields `feerate_per_kw` and `num_nondust_htlcs` of `CommitmentStats`
can both be accessed directly from the `tx: CommitmentTransaction`
field.
We also take this opportunity to rename the balance fields to make it
extra clear what they refer to.
Copy file name to clipboardExpand all lines: lightning/src/ln/channel.rs
+12-18Lines changed: 12 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -880,12 +880,10 @@ struct HTLCStats {
880
880
/// An enum gathering stats on commitment transaction, either local or remote.
881
881
struct CommitmentStats<'a> {
882
882
tx: CommitmentTransaction, // the transaction info
883
-
feerate_per_kw: u32, // the feerate included to build the transaction
884
883
total_fee_sat: u64, // the total fee included in the transaction
885
-
num_nondust_htlcs: usize, // the number of HTLC outputs (dust HTLCs *non*-included)
886
884
htlcs_included: Vec<(HTLCOutputInCommitment, Option<&'a HTLCSource>)>, // the list of HTLCs (dust HTLCs *included*) which were not ignored when building the transaction
887
-
local_balance_msat: u64, // local balance before fees *not* considering dust limits
if msg.htlc_signatures.len() != commitment_stats.num_nondust_htlcs {
3530
-
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)));
3527
+
if msg.htlc_signatures.len() != commitment_stats.tx.htlcs().len() {
3528
+
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())));
3531
3529
}
3532
3530
3533
3531
// Up to LDK 0.0.115, HTLC information was required to be duplicated in the
0 commit comments