Log payment hash of the HTLC that causes a force closure
What changed, and why it matters
This commit only changes a log message to include the payment hash when Lightning Dev Kit force-closes a channel because of an HTLC timeout. It is a debugging/observability improvement, not a security fix.
No security action required; treat as normal observability/logging improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies a single log_info! macro call in lightning/src/chain/channelmonitor.rs. It adds htlc.payment_hash to the existing log line that records when a channel is force-closed due to an HTLC timeout. No logic, checks, or behavior change; purely diagnostic output.
Changed components
lightning/src/chain/channelmonitor.rs logging onlyInspect captured patch +1 / −1
diff --git a/lightning/src/chain/channelmonitor.rs b/lightning/src/chain/channelmonitor.rs
index 38eed18..2373f2c 100644
--- a/lightning/src/chain/channelmonitor.rs
+++ b/lightning/src/chain/channelmonitor.rs
@@ -5599,7 +5599,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
let htlc_outbound = $holder_tx == htlc.offered;
if ( htlc_outbound && htlc.cltv_expiry + LATENCY_GRACE_PERIOD_BLOCKS <= height) ||
(!htlc_outbound && htlc.cltv_expiry <= height + CLTV_CLAIM_BUFFER && self.payment_preimages.contains_key(&htlc.payment_hash)) {
- log_info!(logger, "Force-closing channel due to {} HTLC timeout, HTLC expiry is {}", if htlc_outbound { "outbound" } else { "inbound "}, htlc.cltv_expiry);
+ log_info!(logger, "Force-closing channel due to {} HTLC timeout - HTLC with payment hash {} expires at {}", if htlc_outbound { "outbound" } else { "inbound"}, htlc.payment_hash, htlc.cltv_expiry);
return true;
}
}
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.