Add clarifying comment to signer_maybe_unblocked
What changed, and why it matters
This commit only adds a clarifying code comment explaining why a specific transaction number is used when building a commitment transaction. No code behavior was changed, so there is no security impact.
No action needed; this is a documentation-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds a three-line comment in lightning/src/ln/channel.rs inside signer_maybe_unblocked, explaining that counterparty_next_commitment_transaction_number + 1 is used because the field advances on funding_created but the commitment point advances only on channel_ready. No logic, variables, or control flow were modified.
Changed components
lightning/src/ln/channel.rsInspect captured patch +3 / −0
diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs
index 79b1870..9df76b1 100644
--- a/lightning/src/ln/channel.rs
+++ b/lightning/src/ln/channel.rs
@@ -8429,6 +8429,9 @@ where
}
let funding_signed = if self.context.signer_pending_funding && !self.funding.is_outbound() {
let commitment_data = self.context.build_commitment_transaction(&self.funding,
+ // The previous transaction number (i.e., when adding 1) is used because this field
+ // is advanced when handling funding_created, but the point is not advanced until
+ // handling channel_ready.
self.context.counterparty_next_commitment_transaction_number + 1,
&self.context.counterparty_next_commitment_point.unwrap(), false, false, logger);
let counterparty_initial_commitment_tx = commitment_data.tx;
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.