@@ -4109,9 +4109,9 @@ where
41094109 ///
41104110 /// We take the conservative approach and only assume that a HTLC will
41114111 /// not be in the next commitment when it is guaranteed that it won't be.
4112- #[rustfmt::skip]
41134112 fn get_next_commitment_htlcs(
4114- &self, local: bool, htlc_candidate: Option<HTLCAmountDirection>, include_counterparty_unknown_htlcs: bool,
4113+ &self, local: bool, htlc_candidate: Option<HTLCAmountDirection>,
4114+ include_counterparty_unknown_htlcs: bool,
41154115 ) -> Vec<HTLCAmountDirection> {
41164116 let mut commitment_htlcs = Vec::with_capacity(
41174117 1 + self.pending_inbound_htlcs.len()
@@ -4132,7 +4132,10 @@ where
41324132 (InboundHTLCState::LocalRemoved(..), true) => true,
41334133 (InboundHTLCState::LocalRemoved(..), false) => false,
41344134 })
4135- .map(|&InboundHTLCOutput { amount_msat, .. }| HTLCAmountDirection { outbound: false, amount_msat });
4135+ .map(|&InboundHTLCOutput { amount_msat, .. }| HTLCAmountDirection {
4136+ outbound: false,
4137+ amount_msat,
4138+ });
41364139 // `RemoteRemoved` HTLCs can still be present on the next remote commitment if
41374140 // local produces a commitment before acknowledging the update. These HTLCs
41384141 // will for sure not be present on the next local commitment.
@@ -4147,7 +4150,10 @@ where
41474150 (OutboundHTLCState::AwaitingRemoteRevokeToRemove(..), _) => false,
41484151 (OutboundHTLCState::AwaitingRemovedRemoteRevoke(..), _) => false,
41494152 })
4150- .map(|&OutboundHTLCOutput { amount_msat, .. }| HTLCAmountDirection { outbound: true, amount_msat });
4153+ .map(|&OutboundHTLCOutput { amount_msat, .. }| HTLCAmountDirection {
4154+ outbound: true,
4155+ amount_msat,
4156+ });
41514157
41524158 let holding_cell_htlcs = self.holding_cell_htlc_updates.iter().filter_map(|htlc| {
41534159 if let &HTLCUpdateAwaitingACK::AddHTLC { amount_msat, .. } = htlc {
@@ -4159,11 +4165,18 @@ where
41594165
41604166 if include_counterparty_unknown_htlcs {
41614167 commitment_htlcs.extend(
4162- htlc_candidate.into_iter().chain(pending_inbound_htlcs).chain(pending_outbound_htlcs).chain(holding_cell_htlcs)
4168+ htlc_candidate
4169+ .into_iter()
4170+ .chain(pending_inbound_htlcs)
4171+ .chain(pending_outbound_htlcs)
4172+ .chain(holding_cell_htlcs),
41634173 );
41644174 } else {
41654175 commitment_htlcs.extend(
4166- htlc_candidate.into_iter().chain(pending_inbound_htlcs).chain(pending_outbound_htlcs)
4176+ htlc_candidate
4177+ .into_iter()
4178+ .chain(pending_inbound_htlcs)
4179+ .chain(pending_outbound_htlcs),
41674180 );
41684181 }
41694182
0 commit comments