Skip to content

Commit 4de6b5c

Browse files
committed
Channel logging improvements
Additional trace logs to help with debugging.
1 parent bb5504e commit 4de6b5c

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

lightning/src/ln/channel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8905,8 +8905,8 @@ where
89058905
);
89068906
return_with_htlcs_to_fail!(htlcs_to_fail);
89078907
} else {
8908-
log_debug!(logger, "Received a valid revoke_and_ack with no reply necessary. {} monitor update.",
8909-
release_state_str);
8908+
log_debug!(logger, "Received a valid revoke_and_ack with no reply necessary. {} monitor update {}.",
8909+
release_state_str, monitor_update.update_id);
89108910

89118911
self.monitor_updating_paused(
89128912
false,

lightning/src/ln/channelmanager.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9451,6 +9451,10 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
94519451
for action in actions.into_iter() {
94529452
match action {
94539453
MonitorUpdateCompletionAction::PaymentClaimed { payment_hash, pending_mpp_claim } => {
9454+
let (peer_id, chan_id) = pending_mpp_claim.as_ref().map(|c| (Some(c.0), Some(c.1))).unwrap_or_default();
9455+
let logger = WithContext::from(&self.logger, peer_id, chan_id, Some(payment_hash));
9456+
log_trace!(logger, "Handling PaymentClaimed monitor update completion action");
9457+
94549458
if let Some((counterparty_node_id, chan_id, claim_ptr)) = pending_mpp_claim {
94559459
let per_peer_state = self.per_peer_state.read().unwrap();
94569460
per_peer_state.get(&counterparty_node_id).map(|peer_state_mutex| {
@@ -9526,6 +9530,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
95269530
// `payment_id` should suffice to ensure we never spuriously drop a second
95279531
// event for a duplicate payment.
95289532
if !pending_events.contains(&event_action) {
9533+
log_trace!(logger, "Queuing PaymentClaimed event with event completion action {:?}", event_action.1);
95299534
pending_events.push_back(event_action);
95309535
}
95319536
}
@@ -17109,17 +17114,18 @@ where
1710917114

1711017115
let logger = WithChannelMonitor::from(&args.logger, monitor, None);
1711117116
let channel_id = monitor.channel_id();
17112-
log_info!(
17113-
logger,
17114-
"Queueing monitor update to ensure missing channel is force closed",
17115-
);
1711617117
let monitor_update = ChannelMonitorUpdate {
1711717118
update_id: monitor.get_latest_update_id().saturating_add(1),
1711817119
updates: vec![ChannelMonitorUpdateStep::ChannelForceClosed {
1711917120
should_broadcast: true,
1712017121
}],
1712117122
channel_id: Some(monitor.channel_id()),
1712217123
};
17124+
log_info!(
17125+
logger,
17126+
"Queueing monitor update {} to ensure missing channel is force closed",
17127+
monitor_update.update_id
17128+
);
1712317129
let funding_txo = monitor.get_funding_txo();
1712417130
let update = BackgroundEvent::MonitorUpdateRegeneratedOnStartup {
1712517131
counterparty_node_id,

0 commit comments

Comments
 (0)