@@ -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+.
@@ -900,7 +901,7 @@ impl OutboundPayments {
900
901
901
902
let payment_params = Some ( route_params. payment_params . clone ( ) ) ;
902
903
let ( retryable_payment, onion_session_privs) = self . create_pending_payment (
903
- payment_hash, recipient_onion. clone ( ) , None , & route,
904
+ payment_hash, recipient_onion. clone ( ) , None , None , & route,
904
905
retry_strategy, payment_params, entropy_source, best_block_height
905
906
) ;
906
907
match self . pending_outbound_payments . lock ( ) . unwrap ( ) . entry ( payment_id) {
@@ -1297,8 +1298,9 @@ impl OutboundPayments {
1297
1298
let recipient_onion = RecipientOnionFields :: spontaneous_empty ( ) ;
1298
1299
let payment_params = Some ( route_params. payment_params . clone ( ) ) ;
1299
1300
let ( retryable_payment, onion_session_privs) = self . create_pending_payment (
1300
- payment_hash, recipient_onion. clone ( ) , Some ( keysend_preimage) , & route,
1301
- Some ( retry_strategy) , payment_params, entropy_source, best_block_height
1301
+ payment_hash, recipient_onion. clone ( ) , Some ( keysend_preimage) ,
1302
+ Some ( invoice_request. clone ( ) ) , & route, Some ( retry_strategy) , payment_params,
1303
+ entropy_source, best_block_height
1302
1304
) ;
1303
1305
outbounds. insert ( payment_id, retryable_payment) ;
1304
1306
( total_amount, recipient_onion, Some ( keysend_preimage) , Some ( invoice_request) ,
@@ -1474,7 +1476,7 @@ impl OutboundPayments {
1474
1476
hash_map:: Entry :: Occupied ( _) => Err ( PaymentSendFailure :: DuplicatePayment ) ,
1475
1477
hash_map:: Entry :: Vacant ( entry) => {
1476
1478
let ( payment, onion_session_privs) = self . create_pending_payment (
1477
- payment_hash, recipient_onion, keysend_preimage, route, retry_strategy,
1479
+ payment_hash, recipient_onion, keysend_preimage, None , route, retry_strategy,
1478
1480
payment_params, entropy_source, best_block_height
1479
1481
) ;
1480
1482
entry. insert ( payment) ;
@@ -1485,8 +1487,9 @@ impl OutboundPayments {
1485
1487
1486
1488
fn create_pending_payment < ES : Deref > (
1487
1489
& self , payment_hash : PaymentHash , recipient_onion : RecipientOnionFields ,
1488
- keysend_preimage : Option < PaymentPreimage > , route : & Route , retry_strategy : Option < Retry > ,
1489
- payment_params : Option < PaymentParameters > , entropy_source : & ES , best_block_height : u32
1490
+ keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < InvoiceRequest > ,
1491
+ route : & Route , retry_strategy : Option < Retry > , payment_params : Option < PaymentParameters > ,
1492
+ entropy_source : & ES , best_block_height : u32
1490
1493
) -> ( PendingOutboundPayment , Vec < [ u8 ; 32 ] > )
1491
1494
where
1492
1495
ES :: Target : EntropySource ,
@@ -1507,6 +1510,7 @@ impl OutboundPayments {
1507
1510
payment_secret : recipient_onion. payment_secret ,
1508
1511
payment_metadata : recipient_onion. payment_metadata ,
1509
1512
keysend_preimage,
1513
+ invoice_request,
1510
1514
custom_tlvs : recipient_onion. custom_tlvs ,
1511
1515
starting_block_height : best_block_height,
1512
1516
total_msat : route. get_total_amount ( ) ,
@@ -2059,6 +2063,7 @@ impl_writeable_tlv_based_enum_upgradable!(PendingOutboundPayment,
2059
2063
( 9 , custom_tlvs, optional_vec) ,
2060
2064
( 10 , starting_block_height, required) ,
2061
2065
( 11 , remaining_max_total_routing_fee_msat, option) ,
2066
+ ( 13 , invoice_request, option) ,
2062
2067
( not_written, retry_strategy, ( static_value, None ) ) ,
2063
2068
( not_written, attempts, ( static_value, PaymentAttempts :: new( ) ) ) ,
2064
2069
} ,
0 commit comments