Skip to content

Commit b866dea

Browse files
committed
f fix panic msg, reduce indent
1 parent 7851a18 commit b866dea

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
@@ -3188,19 +3188,18 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F
31883188
},
31893189
HTLCForwardInfo::FailHTLC { htlc_id, err_packet } => {
31903190
log_trace!(self.logger, "Failing HTLC back to channel with short id {} (backward HTLC ID {}) after delay", short_chan_id, htlc_id);
3191-
match chan.get_mut().queue_fail_htlc(htlc_id, err_packet, &self.logger) {
3192-
Err(e) => {
3193-
if let ChannelError::Ignore(msg) = e {
3194-
log_trace!(self.logger, "Failed to fail HTLC with ID {} backwards to short_id {}: {}", htlc_id, short_chan_id, msg);
3195-
} else {
3196-
panic!("Stated return value requirements in get_update_fail_htlc() were not met");
3197-
}
3198-
// fail-backs are best-effort, we probably already have one
3199-
// pending, and if not that's OK, if not, the channel is on
3200-
// the chain and sending the HTLC-Timeout is their problem.
3201-
continue;
3202-
},
3203-
Ok(()) => { },
3191+
if let Err(e) = chan.get_mut().queue_fail_htlc(
3192+
htlc_id, err_packet, &self.logger
3193+
) {
3194+
if let ChannelError::Ignore(msg) = e {
3195+
log_trace!(self.logger, "Failed to fail HTLC with ID {} backwards to short_id {}: {}", htlc_id, short_chan_id, msg);
3196+
} else {
3197+
panic!("Stated return value requirements in queue_fail_htlc() were not met");
3198+
}
3199+
// fail-backs are best-effort, we probably already have one
3200+
// pending, and if not that's OK, if not, the channel is on
3201+
// the chain and sending the HTLC-Timeout is their problem.
3202+
continue;
32043203
}
32053204
},
32063205
}

0 commit comments

Comments
 (0)