Skip to content

Commit 377ca5f

Browse files
committed
Channel logging improvements
Additional trace logs to help with debugging.
1 parent 21110c8 commit 377ca5f

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
@@ -9379,6 +9379,9 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
93799379
for action in actions.into_iter() {
93809380
match action {
93819381
MonitorUpdateCompletionAction::PaymentClaimed { payment_hash, pending_mpp_claim } => {
9382+
let logger = WithContext::from(&self.logger, None, None, Some(payment_hash));
9383+
log_trace!(logger, "Handling PaymentClaimed monitor update completion action");
9384+
93829385
if let Some((counterparty_node_id, chan_id, claim_ptr)) = pending_mpp_claim {
93839386
let per_peer_state = self.per_peer_state.read().unwrap();
93849387
per_peer_state.get(&counterparty_node_id).map(|peer_state_mutex| {
@@ -9454,6 +9457,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
94549457
// `payment_id` should suffice to ensure we never spuriously drop a second
94559458
// event for a duplicate payment.
94569459
if !pending_events.contains(&event_action) {
9460+
log_trace!(logger, "Queuing PaymentClaimed event with event completion action {:?}", event_action.1);
94579461
pending_events.push_back(event_action);
94589462
}
94599463
}
@@ -16984,17 +16988,18 @@ where
1698416988

1698516989
let logger = WithChannelMonitor::from(&args.logger, monitor, None);
1698616990
let channel_id = monitor.channel_id();
16987-
log_info!(
16988-
logger,
16989-
"Queueing monitor update to ensure missing channel is force closed",
16990-
);
1699116991
let monitor_update = ChannelMonitorUpdate {
1699216992
update_id: monitor.get_latest_update_id().saturating_add(1),
1699316993
updates: vec![ChannelMonitorUpdateStep::ChannelForceClosed {
1699416994
should_broadcast: true,
1699516995
}],
1699616996
channel_id: Some(monitor.channel_id()),
1699716997
};
16998+
log_info!(
16999+
logger,
17000+
"Queueing monitor update {} to ensure missing channel is force closed",
17001+
monitor_update.update_id
17002+
);
1699817003
let funding_txo = monitor.get_funding_txo();
1699917004
let update = BackgroundEvent::MonitorUpdateRegeneratedOnStartup {
1700017005
counterparty_node_id,

0 commit comments

Comments
 (0)