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
+23-14Lines changed: 23 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -4140,12 +4140,17 @@ where
4140
4140
// Channel state once they will not be present in the next received commitment
4141
4141
// transaction).
4142
4142
let (local_balance_before_fee_msat, remote_balance_before_fee_msat) = {
4143
-
let mut removed_outbound_total_msat = 0;
4144
-
for htlc in self.pending_outbound_htlcs.iter() {
4145
-
if let OutboundHTLCState::AwaitingRemoteRevokeToRemove(OutboundHTLCOutcome::Success(_, _)) | OutboundHTLCState::AwaitingRemovedRemoteRevoke(OutboundHTLCOutcome::Success(_, _)) = htlc.state {
4146
-
removed_outbound_total_msat += htlc.amount_msat;
4147
-
}
4148
-
}
4143
+
let removed_outbound_total_msat: u64 = self.pending_outbound_htlcs
if let OutboundHTLCState::AwaitingRemoteRevokeToRemove(OutboundHTLCOutcome::Success(_, _)) | OutboundHTLCState::AwaitingRemovedRemoteRevoke(OutboundHTLCOutcome::Success(_, _)) = htlc.state {
4378
-
removed_outbound_total_msat += htlc.amount_msat;
4379
-
}
4380
-
}
4381
-
4380
+
let removed_outbound_total_msat: u64 = self.pending_outbound_htlcs
debug_assert_eq!(stats, self.build_commitment_stats(funding, local, generated_by_local, None, None), "Caught an inconsistency between `TxBuilder::build_commitment_transaction` and the rest of the `TxBuilder` methods");
4619
4628
4620
4629
// This populates the HTLC-source table with the indices from the HTLCs in the commitment
0 commit comments