Skip to content

Commit 2bf8ec0

Browse files
Include invreq in payment onion when sending async payments.
1 parent dad0ef2 commit 2bf8ec0

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lightning/src/ln/outbound_payment.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,7 @@ impl OutboundPayments {
12571257
}
12581258
}
12591259
}
1260-
let (total_msat, recipient_onion, keysend_preimage, onion_session_privs) = {
1260+
let (total_msat, recipient_onion, keysend_preimage, invoice_request, onion_session_privs) = {
12611261
let mut outbounds = self.pending_outbound_payments.lock().unwrap();
12621262
match outbounds.entry(payment_id) {
12631263
hash_map::Entry::Occupied(mut payment) => {
@@ -1299,7 +1299,7 @@ impl OutboundPayments {
12991299

13001300
payment.get_mut().increment_attempts();
13011301

1302-
(total_msat, recipient_onion, keysend_preimage, onion_session_privs)
1302+
(total_msat, recipient_onion, keysend_preimage, None, onion_session_privs)
13031303
},
13041304
PendingOutboundPayment::Legacy { .. } => {
13051305
log_error!(logger, "Unable to retry payments that were initially sent on LDK versions prior to 0.0.102");
@@ -1316,11 +1316,11 @@ impl OutboundPayments {
13161316
return
13171317
},
13181318
PendingOutboundPayment::StaticInvoiceReceived { .. } => {
1319-
let (payment_hash, keysend_preimage, retry_strategy) =
1319+
let (payment_hash, keysend_preimage, retry_strategy, invoice_request) =
13201320
if let PendingOutboundPayment::StaticInvoiceReceived {
1321-
payment_hash, keysend_preimage, retry_strategy, ..
1321+
payment_hash, keysend_preimage, retry_strategy, invoice_request, ..
13221322
} = payment.remove() {
1323-
(payment_hash, keysend_preimage, retry_strategy)
1323+
(payment_hash, keysend_preimage, retry_strategy, invoice_request)
13241324
} else { debug_assert!(false); return };
13251325
let keysend_preimage = Some(keysend_preimage);
13261326
let total_amount = route_params.final_value_msat;
@@ -1332,7 +1332,8 @@ impl OutboundPayments {
13321332
payment_params, entropy_source, best_block_height
13331333
);
13341334
outbounds.insert(payment_id, retryable_payment);
1335-
(total_amount, recipient_onion, keysend_preimage, onion_session_privs)
1335+
(total_amount, recipient_onion, keysend_preimage, Some(invoice_request),
1336+
onion_session_privs)
13361337
},
13371338
PendingOutboundPayment::Fulfilled { .. } => {
13381339
log_error!(logger, "Payment already completed");
@@ -1351,8 +1352,8 @@ impl OutboundPayments {
13511352
}
13521353
};
13531354
let res = self.pay_route_internal(&route, payment_hash, &recipient_onion, keysend_preimage,
1354-
None, payment_id, Some(total_msat), onion_session_privs, node_signer, best_block_height,
1355-
&send_payment_along_path);
1355+
invoice_request.as_ref(), payment_id, Some(total_msat), onion_session_privs, node_signer,
1356+
best_block_height, &send_payment_along_path);
13561357
log_info!(logger, "Result retrying payment id {}: {:?}", &payment_id, res);
13571358
if let Err(e) = res {
13581359
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)