Skip to content

Commit 388d16c

Browse files
committed
Channel logging improvements
Additional trace logs to help with debugging.
1 parent de384ff commit 388d16c

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
@@ -8931,8 +8931,8 @@ where
89318931
);
89328932
return_with_htlcs_to_fail!(htlcs_to_fail);
89338933
} else {
8934-
log_debug!(logger, "Received a valid revoke_and_ack with no reply necessary. {} monitor update.",
8935-
release_state_str);
8934+
log_debug!(logger, "Received a valid revoke_and_ack with no reply necessary. {} monitor update {}.",
8935+
release_state_str, monitor_update.update_id);
89368936

89378937
self.monitor_updating_paused(
89388938
false,

lightning/src/ln/channelmanager.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9479,6 +9479,9 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
94799479
for action in actions.into_iter() {
94809480
match action {
94819481
MonitorUpdateCompletionAction::PaymentClaimed { payment_hash, pending_mpp_claim } => {
9482+
let logger = WithContext::from(&self.logger, None, None, Some(payment_hash));
9483+
log_trace!(logger, "Handling PaymentClaimed monitor update completion action");
9484+
94829485
if let Some((counterparty_node_id, chan_id, claim_ptr)) = pending_mpp_claim {
94839486
let per_peer_state = self.per_peer_state.read().unwrap();
94849487
per_peer_state.get(&counterparty_node_id).map(|peer_state_mutex| {
@@ -9554,6 +9557,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
95549557
// `payment_id` should suffice to ensure we never spuriously drop a second
95559558
// event for a duplicate payment.
95569559
if !pending_events.contains(&event_action) {
9560+
log_trace!(logger, "Queuing PaymentClaimed event with event completion action {:?}", event_action.1);
95579561
pending_events.push_back(event_action);
95589562
}
95599563
}
@@ -17132,17 +17136,18 @@ where
1713217136

1713317137
let logger = WithChannelMonitor::from(&args.logger, monitor, None);
1713417138
let channel_id = monitor.channel_id();
17135-
log_info!(
17136-
logger,
17137-
"Queueing monitor update to ensure missing channel is force closed",
17138-
);
1713917139
let monitor_update = ChannelMonitorUpdate {
1714017140
update_id: monitor.get_latest_update_id().saturating_add(1),
1714117141
updates: vec![ChannelMonitorUpdateStep::ChannelForceClosed {
1714217142
should_broadcast: true,
1714317143
}],
1714417144
channel_id: Some(monitor.channel_id()),
1714517145
};
17146+
log_info!(
17147+
logger,
17148+
"Queueing monitor update {} to ensure missing channel is force closed",
17149+
monitor_update.update_id
17150+
);
1714617151
let funding_txo = monitor.get_funding_txo();
1714717152
let update = BackgroundEvent::MonitorUpdateRegeneratedOnStartup {
1714817153
counterparty_node_id,

0 commit comments

Comments
 (0)