Skip to content

Commit

Permalink
-f Fix line wrapping at 100 chars
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorTigerstrom committed Jun 7, 2022
1 parent cb9ae00 commit cd59bc8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3620,7 +3620,10 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
// Fail a list of HTLCs that were just freed from the holding cell. The HTLCs need to be
// failed backwards or, if they were one of our outgoing HTLCs, then their failure needs to
// be surfaced to the user.
fn fail_holding_cell_htlcs(&self, mut htlcs_to_fail: Vec<(HTLCSource, PaymentHash)>, channel_id: [u8; 32], _counterparty_node_id: &PublicKey) {
fn fail_holding_cell_htlcs(
&self, mut htlcs_to_fail: Vec<(HTLCSource, PaymentHash)>, channel_id: [u8; 32],
_counterparty_node_id: &PublicKey
) {
for (htlc_src, payment_hash) in htlcs_to_fail.drain(..) {
match htlc_src {
HTLCSource::PreviousHopData(HTLCPreviousHopData { .. }) => {
Expand Down Expand Up @@ -5066,7 +5069,11 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
match chan.maybe_free_holding_cell_htlcs(&self.logger) {
Ok((commitment_opt, holding_cell_failed_htlcs)) => {
if !holding_cell_failed_htlcs.is_empty() {
failed_htlcs.push((holding_cell_failed_htlcs, *channel_id, chan.get_counterparty_node_id()));
failed_htlcs.push((
holding_cell_failed_htlcs,
*channel_id,
chan.get_counterparty_node_id()
));

This comment has been minimized.

Copy link
@tnull

tnull Jun 8, 2022

Contributor

Thanks for wrapping at 100 chars! You may want reduce the number of lines, e.g., by including these dangling parentheses in the previous line. I think however we have no strong formatting guidelines for this, so it probably comes down to being a matter of personal taste.

}
if let Some((commitment_update, monitor_update)) = commitment_opt {
if let Err(e) = self.chain_monitor.update_channel(chan.get_funding_txo().unwrap(), monitor_update) {
Expand Down

0 comments on commit cd59bc8

Please sign in to comment.