What changed, and why it matters
This commit only adds and adjusts log messages to help developers debug channel state. It does not change program logic, permissions, or data handling. There is no security issue here.
No action needed. This is a routine debugging/logging improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch is purely cosmetic logging changes in rust-lightning. It adds an update_id to an existing log_debug! line, adds two log_trace! lines inside a PaymentClaimed handling block, and moves/rewords a log_info! line to include the monitor_update.update_id. No functional code paths, checks, or cryptographic operations are modified.
Changed components
lightning/src/ln/channel.rslightning/src/ln/channelmanager.rsInspect captured patch +12 / −6
diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs
index 2068a25..b1c2458 100644
--- a/lightning/src/ln/channel.rs
+++ b/lightning/src/ln/channel.rs
@@ -8905,8 +8905,8 @@ where
);
return_with_htlcs_to_fail!(htlcs_to_fail);
} else {
- log_debug!(logger, "Received a valid revoke_and_ack with no reply necessary. {} monitor update.",
- release_state_str);
+ log_debug!(logger, "Received a valid revoke_and_ack with no reply necessary. {} monitor update {}.",
+ release_state_str, monitor_update.update_id);
self.monitor_updating_paused(
false,
diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs
index 399c51b..f938939 100644
--- a/lightning/src/ln/channelmanager.rs
+++ b/lightning/src/ln/channelmanager.rs
@@ -9451,6 +9451,10 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
for action in actions.into_iter() {
match action {
MonitorUpdateCompletionAction::PaymentClaimed { payment_hash, pending_mpp_claim } => {
+ let (peer_id, chan_id) = pending_mpp_claim.as_ref().map(|c| (Some(c.0), Some(c.1))).unwrap_or_default();
+ let logger = WithContext::from(&self.logger, peer_id, chan_id, Some(payment_hash));
+ log_trace!(logger, "Handling PaymentClaimed monitor update completion action");
+
if let Some((counterparty_node_id, chan_id, claim_ptr)) = pending_mpp_claim {
let per_peer_state = self.per_peer_state.read().unwrap();
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/
// `payment_id` should suffice to ensure we never spuriously drop a second
// event for a duplicate payment.
if !pending_events.contains(&event_action) {
+ log_trace!(logger, "Queuing PaymentClaimed event with event completion action {:?}", event_action.1);
pending_events.push_back(event_action);
}
}
@@ -17109,10 +17114,6 @@ where
let logger = WithChannelMonitor::from(&args.logger, monitor, None);
let channel_id = monitor.channel_id();
- log_info!(
- logger,
- "Queueing monitor update to ensure missing channel is force closed",
- );
let monitor_update = ChannelMonitorUpdate {
update_id: monitor.get_latest_update_id().saturating_add(1),
updates: vec![ChannelMonitorUpdateStep::ChannelForceClosed {
@@ -17120,6 +17121,11 @@ where
}],
channel_id: Some(monitor.channel_id()),
};
+ log_info!(
+ logger,
+ "Queueing monitor update {} to ensure missing channel is force closed",
+ monitor_update.update_id
+ );
let funding_txo = monitor.get_funding_txo();
let update = BackgroundEvent::MonitorUpdateRegeneratedOnStartup {
counterparty_node_id,
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.