Skip to content

Commit 982b9ac

Browse files
committed
Channel logging improvements
Additional trace logs to help with debugging.
1 parent 2febae0 commit 982b9ac

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

lightning/src/ln/channel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8877,8 +8877,8 @@ where
88778877
);
88788878
return_with_htlcs_to_fail!(htlcs_to_fail);
88798879
} else {
8880-
log_debug!(logger, "Received a valid revoke_and_ack with no reply necessary. {} monitor update.",
8881-
release_state_str);
8880+
log_debug!(logger, "Received a valid revoke_and_ack with no reply necessary. {} monitor update {}.",
8881+
release_state_str, monitor_update.update_id);
88828882

88838883
self.monitor_updating_paused(
88848884
false,

lightning/src/ln/channelmanager.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9412,6 +9412,9 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
94129412
for action in actions.into_iter() {
94139413
match action {
94149414
MonitorUpdateCompletionAction::PaymentClaimed { payment_hash, pending_mpp_claim } => {
9415+
let logger = WithContext::from(&self.logger, None, None, Some(payment_hash));
9416+
log_trace!(logger, "Handling PaymentClaimed monitor update completion action");
9417+
94159418
if let Some((counterparty_node_id, chan_id, claim_ptr)) = pending_mpp_claim {
94169419
let per_peer_state = self.per_peer_state.read().unwrap();
94179420
per_peer_state.get(&counterparty_node_id).map(|peer_state_mutex| {
@@ -9487,6 +9490,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
94879490
// `payment_id` should suffice to ensure we never spuriously drop a second
94889491
// event for a duplicate payment.
94899492
if !pending_events.contains(&event_action) {
9493+
log_trace!(logger, "Queuing PaymentClaimed event with event completion action {:?}", event_action.1);
94909494
pending_events.push_back(event_action);
94919495
}
94929496
}
@@ -17022,17 +17026,18 @@ where
1702217026

1702317027
let logger = WithChannelMonitor::from(&args.logger, monitor, None);
1702417028
let channel_id = monitor.channel_id();
17025-
log_info!(
17026-
logger,
17027-
"Queueing monitor update to ensure missing channel is force closed",
17028-
);
1702917029
let monitor_update = ChannelMonitorUpdate {
1703017030
update_id: monitor.get_latest_update_id().saturating_add(1),
1703117031
updates: vec![ChannelMonitorUpdateStep::ChannelForceClosed {
1703217032
should_broadcast: true,
1703317033
}],
1703417034
channel_id: Some(monitor.channel_id()),
1703517035
};
17036+
log_info!(
17037+
logger,
17038+
"Queueing monitor update {} to ensure missing channel is force closed",
17039+
monitor_update.update_id
17040+
);
1703617041
let funding_txo = monitor.get_funding_txo();
1703717042
let update = BackgroundEvent::MonitorUpdateRegeneratedOnStartup {
1703817043
counterparty_node_id,

0 commit comments

Comments
 (0)