@@ -4059,7 +4059,8 @@ where
4059
4059
None => {
4060
4060
let error = format!("Channel with id {} not found for the passed counterparty node_id {}",
4061
4061
next_hop_channel_id, next_node_id);
4062
- log_error!(self.logger, "{} when attempting to forward intercepted HTLC", error);
4062
+ let logger = WithContext::from(&self.logger, Some(next_node_id), Some(*next_hop_channel_id));
4063
+ log_error!(logger, "{} when attempting to forward intercepted HTLC", error);
4063
4064
return Err(APIError::ChannelUnavailable {
4064
4065
err: error
4065
4066
})
@@ -4147,6 +4148,7 @@ where
4147
4148
4148
4149
for (short_chan_id, mut pending_forwards) in forward_htlcs {
4149
4150
if short_chan_id != 0 {
4151
+ let mut forwarding_counterparty = None;
4150
4152
macro_rules! forwarding_channel_not_found {
4151
4153
() => {
4152
4154
for forward_info in pending_forwards.drain(..) {
@@ -4160,7 +4162,8 @@ where
4160
4162
}) => {
4161
4163
macro_rules! failure_handler {
4162
4164
($msg: expr, $err_code: expr, $err_data: expr, $phantom_ss: expr, $next_hop_unknown: expr) => {
4163
- log_info!(self.logger, "Failed to accept/forward incoming HTLC: {}", $msg);
4165
+ let logger = WithContext::from(&self.logger, forwarding_counterparty, Some(prev_funding_outpoint.to_channel_id()));
4166
+ log_info!(logger, "Failed to accept/forward incoming HTLC: {}", $msg);
4164
4167
4165
4168
let htlc_source = HTLCSource::PreviousHopData(HTLCPreviousHopData {
4166
4169
short_channel_id: prev_short_channel_id,
@@ -4259,6 +4262,7 @@ where
4259
4262
continue;
4260
4263
}
4261
4264
};
4265
+ forwarding_counterparty = Some(counterparty_node_id);
4262
4266
let per_peer_state = self.per_peer_state.read().unwrap();
4263
4267
let peer_state_mutex_opt = per_peer_state.get(&counterparty_node_id);
4264
4268
if peer_state_mutex_opt.is_none() {
0 commit comments