@@ -83,6 +83,7 @@ pub(crate) enum PendingOutboundPayment {
83
83
payment_secret : Option < PaymentSecret > ,
84
84
payment_metadata : Option < Vec < u8 > > ,
85
85
keysend_preimage : Option < PaymentPreimage > ,
86
+ invoice_request : Option < InvoiceRequest > ,
86
87
custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
87
88
pending_amt_msat : u64 ,
88
89
/// Used to track the fee paid. Present iff the payment was serialized on 0.0.103+.
@@ -910,7 +911,7 @@ impl OutboundPayments {
910
911
911
912
let payment_params = Some ( route_params. payment_params . clone ( ) ) ;
912
913
let ( retryable_payment, onion_session_privs) = self . create_pending_payment (
913
- payment_hash, recipient_onion. clone ( ) , None , & route,
914
+ payment_hash, recipient_onion. clone ( ) , None , None , & route,
914
915
retry_strategy, payment_params, entropy_source, best_block_height
915
916
) ;
916
917
match self . pending_outbound_payments . lock ( ) . unwrap ( ) . entry ( payment_id) {
@@ -1308,8 +1309,9 @@ impl OutboundPayments {
1308
1309
let retry_strategy = Some ( retry_strategy) ;
1309
1310
let payment_params = Some ( route_params. payment_params . clone ( ) ) ;
1310
1311
let ( retryable_payment, onion_session_privs) = self . create_pending_payment (
1311
- payment_hash, recipient_onion. clone ( ) , Some ( keysend_preimage) , & route,
1312
- retry_strategy, payment_params, entropy_source, best_block_height
1312
+ payment_hash, recipient_onion. clone ( ) , Some ( keysend_preimage) ,
1313
+ Some ( invoice_request. clone ( ) ) , & route, retry_strategy, payment_params,
1314
+ entropy_source, best_block_height
1313
1315
) ;
1314
1316
outbounds. insert ( payment_id, retryable_payment) ;
1315
1317
( total_amount, recipient_onion, Some ( keysend_preimage) , Some ( invoice_request) ,
@@ -1485,7 +1487,7 @@ impl OutboundPayments {
1485
1487
hash_map:: Entry :: Occupied ( _) => Err ( PaymentSendFailure :: DuplicatePayment ) ,
1486
1488
hash_map:: Entry :: Vacant ( entry) => {
1487
1489
let ( payment, onion_session_privs) = self . create_pending_payment (
1488
- payment_hash, recipient_onion, keysend_preimage, route, retry_strategy,
1490
+ payment_hash, recipient_onion, keysend_preimage, None , route, retry_strategy,
1489
1491
payment_params, entropy_source, best_block_height
1490
1492
) ;
1491
1493
entry. insert ( payment) ;
@@ -1496,8 +1498,9 @@ impl OutboundPayments {
1496
1498
1497
1499
fn create_pending_payment < ES : Deref > (
1498
1500
& self , payment_hash : PaymentHash , recipient_onion : RecipientOnionFields ,
1499
- keysend_preimage : Option < PaymentPreimage > , route : & Route , retry_strategy : Option < Retry > ,
1500
- payment_params : Option < PaymentParameters > , entropy_source : & ES , best_block_height : u32
1501
+ keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < InvoiceRequest > ,
1502
+ route : & Route , retry_strategy : Option < Retry > , payment_params : Option < PaymentParameters > ,
1503
+ entropy_source : & ES , best_block_height : u32
1501
1504
) -> ( PendingOutboundPayment , Vec < [ u8 ; 32 ] > )
1502
1505
where
1503
1506
ES :: Target : EntropySource ,
@@ -1518,6 +1521,7 @@ impl OutboundPayments {
1518
1521
payment_secret : recipient_onion. payment_secret ,
1519
1522
payment_metadata : recipient_onion. payment_metadata ,
1520
1523
keysend_preimage,
1524
+ invoice_request,
1521
1525
custom_tlvs : recipient_onion. custom_tlvs ,
1522
1526
starting_block_height : best_block_height,
1523
1527
total_msat : route. get_total_amount ( ) ,
@@ -2075,6 +2079,7 @@ impl_writeable_tlv_based_enum_upgradable!(PendingOutboundPayment,
2075
2079
( 9 , custom_tlvs, optional_vec) ,
2076
2080
( 10 , starting_block_height, required) ,
2077
2081
( 11 , remaining_max_total_routing_fee_msat, option) ,
2082
+ ( 13 , invoice_request, option) ,
2078
2083
( not_written, retry_strategy, ( static_value, None ) ) ,
2079
2084
( not_written, attempts, ( static_value, PaymentAttempts :: new( ) ) ) ,
2080
2085
} ,
0 commit comments