Rustfmt Channel::get_last_revoke_and_ack
What changed, and why it matters
This commit only reformats a single Rust function using rustfmt. It removes a #[rustfmt::skip] attribute and adjusts line breaks and indentation. No logic, behavior, or security properties of the code are changed.
No security action needed. This is a cosmetic/style-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is a pure formatting change in lightning/src/ln/channel.rs for the Channel::get_last_revoke_and_ack method. It removes the #[rustfmt::skip] directive, rewraps the function signature, debug_assert!, method call, and chained expression to conform to rustfmt style, and adds a trailing semicolon after the returned struct literal. The actual control flow, method calls, and values remain identical.
Changed components
lightning/src/ln/channel.rsInspect captured patch +19 / −7
diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs
index 3d25934..7ec00fc 100644
--- a/lightning/src/ln/channel.rs
+++ b/lightning/src/ln/channel.rs
@@ -8958,12 +8958,24 @@ where
}
}
- #[rustfmt::skip]
- fn get_last_revoke_and_ack<L: Deref>(&mut self, logger: &L) -> Option<msgs::RevokeAndACK> where L::Target: Logger {
- 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.as_ref()
- .release_commitment_secret(self.holder_commitment_point.next_transaction_number() + 2).ok();
+ fn get_last_revoke_and_ack<L: Deref>(&mut self, logger: &L) -> Option<msgs::RevokeAndACK>
+ where
+ L::Target: Logger,
+ {
+ 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
+ .as_ref()
+ .release_commitment_secret(self.holder_commitment_point.next_transaction_number() + 2)
+ .ok();
if let Some(per_commitment_secret) = per_commitment_secret {
if self.holder_commitment_point.can_advance() {
self.context.signer_pending_revoke_and_ack = false;
@@ -8973,7 +8985,7 @@ where
next_per_commitment_point: self.holder_commitment_point.next_point(),
#[cfg(taproot)]
next_local_nonce: None,
- })
+ });
}
}
if !self.holder_commitment_point.can_advance() {
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.