Skip to content

Commit b5192a7

Browse files
Include invreq in payment onion when sending async payments.
1 parent 61bd212 commit b5192a7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lightning/src/ln/outbound_payment.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ impl OutboundPayments {
12311231
}
12321232
}
12331233
}
1234-
let (total_msat, recipient_onion, keysend_preimage, onion_session_privs) = {
1234+
let (total_msat, recipient_onion, keysend_preimage, invoice_request, onion_session_privs) = {
12351235
let mut outbounds = self.pending_outbound_payments.lock().unwrap();
12361236
match outbounds.entry(payment_id) {
12371237
hash_map::Entry::Occupied(mut payment) => {
@@ -1273,7 +1273,7 @@ impl OutboundPayments {
12731273

12741274
payment.get_mut().increment_attempts();
12751275

1276-
(total_msat, recipient_onion, keysend_preimage, onion_session_privs)
1276+
(total_msat, recipient_onion, keysend_preimage, None, onion_session_privs)
12771277
},
12781278
PendingOutboundPayment::Legacy { .. } => {
12791279
log_error!(logger, "Unable to retry payments that were initially sent on LDK versions prior to 0.0.102");
@@ -1291,7 +1291,7 @@ impl OutboundPayments {
12911291
},
12921292
PendingOutboundPayment::StaticInvoiceReceived { .. } => {
12931293
let PendingOutboundPayment::StaticInvoiceReceived {
1294-
payment_hash, keysend_preimage, retry_strategy, ..
1294+
payment_hash, keysend_preimage, retry_strategy, invoice_request, ..
12951295
} = payment.remove() else { debug_assert!(false); return };
12961296
let total_amount = route_params.final_value_msat;
12971297
let recipient_onion = RecipientOnionFields::spontaneous_empty();
@@ -1301,7 +1301,8 @@ impl OutboundPayments {
13011301
Some(retry_strategy), payment_params, entropy_source, best_block_height
13021302
);
13031303
outbounds.insert(payment_id, retryable_payment);
1304-
(total_amount, recipient_onion, Some(keysend_preimage), onion_session_privs)
1304+
(total_amount, recipient_onion, Some(keysend_preimage), Some(invoice_request),
1305+
onion_session_privs)
13051306
},
13061307
PendingOutboundPayment::Fulfilled { .. } => {
13071308
log_error!(logger, "Payment already completed");
@@ -1320,8 +1321,8 @@ impl OutboundPayments {
13201321
}
13211322
};
13221323
let res = self.pay_route_internal(&route, payment_hash, &recipient_onion, keysend_preimage,
1323-
None, payment_id, Some(total_msat), onion_session_privs, node_signer, best_block_height,
1324-
&send_payment_along_path);
1324+
invoice_request.as_ref(), payment_id, Some(total_msat), onion_session_privs, node_signer,
1325+
best_block_height, &send_payment_along_path);
13251326
log_info!(logger, "Result retrying payment id {}: {:?}", &payment_id, res);
13261327
if let Err(e) = res {
13271328
self.handle_pay_route_err(e, payment_id, payment_hash, route, route_params, router, first_hops, inflight_htlcs, entropy_source, node_signer, best_block_height, logger, pending_events, send_payment_along_path);

0 commit comments

Comments
 (0)