Skip to content

Commit 2be5e37

Browse files
committed
Set log metadata in a few additional locations in channelmanager
1 parent b0606a1 commit 2be5e37

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5366,6 +5366,7 @@ where
53665366
}
53675367
if valid_mpp {
53685368
for htlc in sources.drain(..) {
5369+
let prev_hop_chan_id = htlc.prev_hop.outpoint.to_channel_id();
53695370
if let Err((pk, err)) = self.claim_funds_from_hop(
53705371
htlc.prev_hop, payment_preimage,
53715372
|_, definitely_duplicate| {
@@ -5376,6 +5377,7 @@ where
53765377
if let msgs::ErrorAction::IgnoreError = err.err.action {
53775378
// We got a temporary failure updating monitor, but will claim the
53785379
// HTLC when the monitor updating is restored (or on chain).
5380+
let logger = WithContext::from(&self.logger, None, Some(prev_hop_chan_id));
53795381
log_error!(self.logger, "Temporary failure claiming HTLC, treating as success: {}", err.err.err);
53805382
} else { errs.push((pk, err)); }
53815383
}
@@ -10035,7 +10037,7 @@ where
1003510037
log_error!(logger, "A ChannelManager is stale compared to the current ChannelMonitor!");
1003610038
log_error!(logger, " The channel will be force-closed and the latest commitment transaction from the ChannelMonitor broadcast.");
1003710039
if channel.context.get_latest_monitor_update_id() < monitor.get_latest_update_id() {
10038-
log_error!(args.logger, " The ChannelMonitor for channel {} is at update_id {} but the ChannelManager is at update_id {}.",
10040+
log_error!(logger, " The ChannelMonitor for channel {} is at update_id {} but the ChannelManager is at update_id {}.",
1003910041
&channel.context.channel_id(), monitor.get_latest_update_id(), channel.context.get_latest_monitor_update_id());
1004010042
}
1004110043
if channel.get_cur_holder_commitment_transaction_number() > monitor.get_cur_holder_commitment_number() {
@@ -10431,7 +10433,7 @@ where
1043110433
let counterparty_opt = id_to_peer.get(&monitor.get_funding_txo().0.to_channel_id());
1043210434
let chan_id = monitor.get_funding_txo().0.to_channel_id();
1043310435
if counterparty_opt.is_none() {
10434-
let logger = WithContext::from(&args.logger, None, Some(chan_id));
10436+
let logger = WithChannelMonitor::from(&args.logger, monitor);
1043510437
for (htlc_source, (htlc, _)) in monitor.get_pending_or_resolved_outbound_htlcs() {
1043610438
if let HTLCSource::OutboundRoute { payment_id, session_priv, path, .. } = htlc_source {
1043710439
if path.hops.is_empty() {

0 commit comments

Comments
 (0)