Skip to content

Commit 3724a07

Browse files
committed
f fix panic msg, reduce indent
1 parent d8db631 commit 3724a07

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3181,19 +3181,18 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
31813181
},
31823182
HTLCForwardInfo::FailHTLC { htlc_id, err_packet } => {
31833183
log_trace!(self.logger, "Failing HTLC back to channel with short id {} (backward HTLC ID {}) after delay", short_chan_id, htlc_id);
3184-
match chan.get_mut().queue_fail_htlc(htlc_id, err_packet, &self.logger) {
3185-
Err(e) => {
3186-
if let ChannelError::Ignore(msg) = e {
3187-
log_trace!(self.logger, "Failed to fail HTLC with ID {} backwards to short_id {}: {}", htlc_id, short_chan_id, msg);
3188-
} else {
3189-
panic!("Stated return value requirements in get_update_fail_htlc() were not met");
3190-
}
3191-
// fail-backs are best-effort, we probably already have one
3192-
// pending, and if not that's OK, if not, the channel is on
3193-
// the chain and sending the HTLC-Timeout is their problem.
3194-
continue;
3195-
},
3196-
Ok(()) => { },
3184+
if let Err(e) = chan.get_mut().queue_fail_htlc(
3185+
htlc_id, err_packet, &self.logger
3186+
) {
3187+
if let ChannelError::Ignore(msg) = e {
3188+
log_trace!(self.logger, "Failed to fail HTLC with ID {} backwards to short_id {}: {}", htlc_id, short_chan_id, msg);
3189+
} else {
3190+
panic!("Stated return value requirements in queue_fail_htlc() were not met");
3191+
}
3192+
// fail-backs are best-effort, we probably already have one
3193+
// pending, and if not that's OK, if not, the channel is on
3194+
// the chain and sending the HTLC-Timeout is their problem.
3195+
continue;
31973196
}
31983197
},
31993198
}

0 commit comments

Comments
 (0)