Add hold_htlcs param to pay_route_internal
What changed, and why it matters
This commit is a small internal code cleanup that adds a new parameter called hold_htlcs to a private payment-sending helper function. The parameter is always set to false everywhere it is used, so it does not change any actual behavior. It simply prepares the code for a future Lightning protocol feature that lets senders ask intermediate nodes to hold payments until the recipient comes back online. There is no security issue in this change itself.
No security action required. Treat as normal feature groundwork. Review the eventual follow-up commits that actually wire hold_htlcs_at_next_hop to update_add_htlc and release_held_htlc handling when they land.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies lightning/src/ln/outbound_payment.rs to add a bool hold_htlcs_at_next_hop parameter to the private pay_route_internal method and updates all call sites to pass false. The parameter is not consumed anywhere in the visible diff and no functional logic changes. It is groundwork for BOLT PR 989, which introduces held HTLCs for often-offline senders. No new wire behavior, state machine changes, or security-sensitive logic are present.
Changed components
lightning/src/ln/outbound_payment.rsInspect captured patch +9 / −9
diff --git a/lightning/src/ln/outbound_payment.rs b/lightning/src/ln/outbound_payment.rs
index 465d2ee..d751d96 100644
--- a/lightning/src/ln/outbound_payment.rs
+++ b/lightning/src/ln/outbound_payment.rs
@@ -1097,8 +1097,8 @@ where
let result = self.pay_route_internal(
&route, payment_hash, &recipient_onion, keysend_preimage, invoice_request, Some(&bolt12_invoice), payment_id,
- Some(route_params.final_value_msat), &onion_session_privs, node_signer, best_block_height,
- &send_payment_along_path
+ Some(route_params.final_value_msat), &onion_session_privs, false, node_signer,
+ best_block_height, &send_payment_along_path
);
log_info!(
self.logger, "Sending payment with id {} and hash {} returned {:?}", payment_id,
@@ -1489,7 +1489,7 @@ where
})?;
let res = self.pay_route_internal(&route, payment_hash, &recipient_onion,
- keysend_preimage, None, None, payment_id, None, &onion_session_privs, node_signer,
+ keysend_preimage, None, None, payment_id, None, &onion_session_privs, false, node_signer,
best_block_height, &send_payment_along_path);
log_info!(self.logger, "Sending payment with id {} and hash {} returned {:?}",
payment_id, payment_hash, res);
@@ -1652,8 +1652,8 @@ where
}
};
let res = self.pay_route_internal(&route, payment_hash, &recipient_onion, keysend_preimage,
- invoice_request.as_ref(), bolt12_invoice.as_ref(), payment_id, Some(total_msat), &onion_session_privs, node_signer,
- best_block_height, &send_payment_along_path);
+ invoice_request.as_ref(), bolt12_invoice.as_ref(), payment_id, Some(total_msat),
+ &onion_session_privs, false, node_signer, best_block_height, &send_payment_along_path);
log_info!(self.logger, "Result retrying payment id {}: {:?}", &payment_id, res);
if let Err(e) = res {
self.handle_pay_route_err(
@@ -1813,8 +1813,8 @@ where
let recipient_onion_fields = RecipientOnionFields::spontaneous_empty();
match self.pay_route_internal(&route, payment_hash, &recipient_onion_fields,
- None, None, None, payment_id, None, &onion_session_privs, node_signer, best_block_height,
- &send_payment_along_path
+ None, None, None, payment_id, None, &onion_session_privs, false, node_signer,
+ best_block_height, &send_payment_along_path
) {
Ok(()) => Ok((payment_hash, payment_id)),
Err(e) => {
@@ -2062,7 +2062,7 @@ where
&self, route: &Route, payment_hash: PaymentHash, recipient_onion: &RecipientOnionFields,
keysend_preimage: Option<PaymentPreimage>, invoice_request: Option<&InvoiceRequest>, bolt12_invoice: Option<&PaidBolt12Invoice>,
payment_id: PaymentId, recv_value_msat: Option<u64>, onion_session_privs: &Vec<[u8; 32]>,
- node_signer: &NS, best_block_height: u32, send_payment_along_path: &F
+ hold_htlcs_at_next_hop: bool, node_signer: &NS, best_block_height: u32, send_payment_along_path: &F
) -> Result<(), PaymentSendFailure>
where
NS::Target: NodeSigner,
@@ -2185,7 +2185,7 @@ where
{
self.pay_route_internal(route, payment_hash, &recipient_onion,
keysend_preimage, None, None, payment_id, recv_value_msat, &onion_session_privs,
- node_signer, best_block_height, &send_payment_along_path)
+ false, node_signer, best_block_height, &send_payment_along_path)
.map_err(|e| { self.remove_outbound_if_all_failed(payment_id, &e); e })
}
Why this scored 13/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.