Clean up rustfmt'd Channel::get_last_revoke_and_ack
What changed, and why it matters
This commit is purely a code-style cleanup. It renames a local variable and removes line breaks introduced by an automatic formatter in the previous commit. There is no functional change to the program's behavior and no security relevance.
No security action needed. Treat as a normal formatting/refactoring commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff in lightning/src/ln/channel.rs refactors Channel::get_last_revoke_and_ack. It introduces a signer local binding for &self.context.holder_signer and uses it in both try_resolve_pending and the subsequent release_commitment_secret call. The previous version passed &self.context.holder_signer directly and split the call chain across multiple lines. The logic, order of operations, and data flow are unchanged.
Changed components
lightning/src/ln/channel.rsInspect captured patch +3 / −8
diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs
index 7ec00fc..587ee94 100644
--- a/lightning/src/ln/channel.rs
+++ b/lightning/src/ln/channel.rs
@@ -8965,14 +8965,9 @@ where
debug_assert!(
self.holder_commitment_point.next_transaction_number() <= INITIAL_COMMITMENT_NUMBER - 2
);
- self.holder_commitment_point.try_resolve_pending(
- &self.context.holder_signer,
- &self.context.secp_ctx,
- logger,
- );
- let per_commitment_secret = self
- .context
- .holder_signer
+ let signer = &self.context.holder_signer;
+ self.holder_commitment_point.try_resolve_pending(signer, &self.context.secp_ctx, logger);
+ let per_commitment_secret = signer
.as_ref()
.release_commitment_secret(self.holder_commitment_point.next_transaction_number() + 2)
.ok();
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.