Follow-ups from removing async_payments cfg flag
What changed, and why it matters
This commit is a minor code cleanup. It removes leading underscore prefixes from variable names (like `_recipient_id` becoming `recipient_id`) after a feature flag was removed. These underscores are a Rust convention meaning 'this variable is currently unused.' Once the feature became always-enabled, the variables are now used, so the underscores were no longer appropriate. There is no functional change and no security impact.
No action needed. This is a non-functional cleanup change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch removes _ prefixes from identifiers in lightning/src/ln/channelmanager.rs that were previously cfg-gated behind the removed async_payments feature flag. In Rust, a leading underscore suppresses unused-variable warnings. Now that the code is unconditionally compiled, the variables are referenced and the prefix is removed. The diff shows pure renaming with no logic changes, no new behavior, and no change to control flow or data handling.
Changed components
lightning/src/ln/channelmanager.rsInspect captured patch +24 / −26
diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs
index e461435..d72a871 100644
--- a/lightning/src/ln/channelmanager.rs
+++ b/lightning/src/ln/channelmanager.rs
@@ -14317,11 +14317,9 @@ where
let invoice_request = match self.flow.verify_invoice_request(invoice_request, context) {
Ok(InvreqResponseInstructions::SendInvoice(invoice_request)) => invoice_request,
- Ok(InvreqResponseInstructions::SendStaticInvoice {
- recipient_id: _recipient_id, invoice_id: _invoice_id
- }) => {
+ Ok(InvreqResponseInstructions::SendStaticInvoice { recipient_id, invoice_id }) => {
self.pending_events.lock().unwrap().push_back((Event::StaticInvoiceRequested {
- recipient_id: _recipient_id, invoice_id: _invoice_id, reply_path: responder
+ recipient_id, invoice_id, reply_path: responder
}, None));
return None
@@ -14443,29 +14441,29 @@ where
L::Target: Logger,
{
fn handle_offer_paths_request(
- &self, _message: OfferPathsRequest, _context: AsyncPaymentsContext,
- _responder: Option<Responder>,
+ &self, _message: OfferPathsRequest, context: AsyncPaymentsContext,
+ responder: Option<Responder>,
) -> Option<(OfferPaths, ResponseInstruction)> {
let peers = self.get_peers_for_blinded_path();
let entropy = &*self.entropy_source;
let (message, reply_path_context) =
- match self.flow.handle_offer_paths_request(_context, peers, entropy) {
+ match self.flow.handle_offer_paths_request(context, peers, entropy) {
Some(msg) => msg,
None => return None,
};
- _responder.map(|resp| (message, resp.respond_with_reply_path(reply_path_context)))
+ responder.map(|resp| (message, resp.respond_with_reply_path(reply_path_context)))
}
fn handle_offer_paths(
- &self, _message: OfferPaths, _context: AsyncPaymentsContext, _responder: Option<Responder>,
+ &self, message: OfferPaths, context: AsyncPaymentsContext, responder: Option<Responder>,
) -> Option<(ServeStaticInvoice, ResponseInstruction)> {
- let responder = match _responder {
+ let responder = match responder {
Some(responder) => responder,
None => return None,
};
let (serve_static_invoice, reply_context) = match self.flow.handle_offer_paths(
- _message,
- _context,
+ message,
+ context,
responder.clone(),
self.get_peers_for_blinded_path(),
self.list_usable_channels(),
@@ -14484,16 +14482,16 @@ where
}
fn handle_serve_static_invoice(
- &self, _message: ServeStaticInvoice, _context: AsyncPaymentsContext,
- _responder: Option<Responder>,
+ &self, message: ServeStaticInvoice, context: AsyncPaymentsContext,
+ responder: Option<Responder>,
) {
- let responder = match _responder {
+ let responder = match responder {
Some(resp) => resp,
None => return,
};
let (recipient_id, invoice_id) =
- match self.flow.verify_serve_static_invoice_message(&_message, _context) {
+ match self.flow.verify_serve_static_invoice_message(&message, context) {
Ok((recipient_id, inv_id)) => (recipient_id, inv_id),
Err(()) => return,
};
@@ -14501,8 +14499,8 @@ where
let mut pending_events = self.pending_events.lock().unwrap();
pending_events.push_back((
Event::PersistStaticInvoice {
- invoice: _message.invoice,
- invoice_slot: _message.invoice_slot,
+ invoice: message.invoice,
+ invoice_slot: message.invoice_slot,
recipient_id,
invoice_id,
invoice_persisted_path: responder,
@@ -14512,24 +14510,24 @@ where
}
fn handle_static_invoice_persisted(
- &self, _message: StaticInvoicePersisted, _context: AsyncPaymentsContext,
+ &self, _message: StaticInvoicePersisted, context: AsyncPaymentsContext,
) {
- let should_persist = self.flow.handle_static_invoice_persisted(_context);
+ let should_persist = self.flow.handle_static_invoice_persisted(context);
if should_persist {
let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
}
}
fn handle_held_htlc_available(
- &self, _message: HeldHtlcAvailable, _context: AsyncPaymentsContext,
- _responder: Option<Responder>,
+ &self, _message: HeldHtlcAvailable, context: AsyncPaymentsContext,
+ responder: Option<Responder>,
) -> Option<(ReleaseHeldHtlc, ResponseInstruction)> {
- self.flow.verify_inbound_async_payment_context(_context).ok()?;
- return _responder.map(|responder| (ReleaseHeldHtlc {}, responder.respond()));
+ self.flow.verify_inbound_async_payment_context(context).ok()?;
+ return responder.map(|responder| (ReleaseHeldHtlc {}, responder.respond()));
}
- fn handle_release_held_htlc(&self, _message: ReleaseHeldHtlc, _context: AsyncPaymentsContext) {
- let payment_id = match _context {
+ fn handle_release_held_htlc(&self, _message: ReleaseHeldHtlc, context: AsyncPaymentsContext) {
+ let payment_id = match context {
AsyncPaymentsContext::OutboundPayment { payment_id } => payment_id,
_ => return,
};
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.