@@ -86,6 +86,7 @@ pub(crate) enum PendingOutboundPayment {
86
86
payment_secret : Option < PaymentSecret > ,
87
87
payment_metadata : Option < Vec < u8 > > ,
88
88
keysend_preimage : Option < PaymentPreimage > ,
89
+ invoice_request : Option < InvoiceRequest > ,
89
90
custom_tlvs : Vec < ( u64 , Vec < u8 > ) > ,
90
91
pending_amt_msat : u64 ,
91
92
/// Used to track the fee paid. Present iff the payment was serialized on 0.0.103+.
@@ -892,7 +893,7 @@ impl OutboundPayments {
892
893
893
894
let payment_params = Some ( route_params. payment_params . clone ( ) ) ;
894
895
let ( retryable_payment, onion_session_privs) = self . create_pending_payment (
895
- payment_hash, recipient_onion. clone ( ) , None , & route,
896
+ payment_hash, recipient_onion. clone ( ) , None , None , & route,
896
897
retry_strategy, payment_params, entropy_source, best_block_height
897
898
) ;
898
899
match self . pending_outbound_payments . lock ( ) . unwrap ( ) . entry ( payment_id) {
@@ -1324,8 +1325,9 @@ impl OutboundPayments {
1324
1325
let retry_strategy = Some ( retry_strategy) ;
1325
1326
let payment_params = Some ( route_params. payment_params . clone ( ) ) ;
1326
1327
let ( retryable_payment, onion_session_privs) = self . create_pending_payment (
1327
- payment_hash, recipient_onion. clone ( ) , Some ( keysend_preimage) , & route,
1328
- retry_strategy, payment_params, entropy_source, best_block_height
1328
+ payment_hash, recipient_onion. clone ( ) , Some ( keysend_preimage) ,
1329
+ Some ( invoice_request. clone ( ) ) , & route, retry_strategy, payment_params,
1330
+ entropy_source, best_block_height
1329
1331
) ;
1330
1332
outbounds. insert ( payment_id, retryable_payment) ;
1331
1333
( total_amount, recipient_onion, Some ( keysend_preimage) , Some ( invoice_request) ,
@@ -1501,7 +1503,7 @@ impl OutboundPayments {
1501
1503
hash_map:: Entry :: Occupied ( _) => Err ( PaymentSendFailure :: DuplicatePayment ) ,
1502
1504
hash_map:: Entry :: Vacant ( entry) => {
1503
1505
let ( payment, onion_session_privs) = self . create_pending_payment (
1504
- payment_hash, recipient_onion, keysend_preimage, route, retry_strategy,
1506
+ payment_hash, recipient_onion, keysend_preimage, None , route, retry_strategy,
1505
1507
payment_params, entropy_source, best_block_height
1506
1508
) ;
1507
1509
entry. insert ( payment) ;
@@ -1512,8 +1514,9 @@ impl OutboundPayments {
1512
1514
1513
1515
fn create_pending_payment < ES : Deref > (
1514
1516
& self , payment_hash : PaymentHash , recipient_onion : RecipientOnionFields ,
1515
- keysend_preimage : Option < PaymentPreimage > , route : & Route , retry_strategy : Option < Retry > ,
1516
- payment_params : Option < PaymentParameters > , entropy_source : & ES , best_block_height : u32
1517
+ keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < InvoiceRequest > ,
1518
+ route : & Route , retry_strategy : Option < Retry > , payment_params : Option < PaymentParameters > ,
1519
+ entropy_source : & ES , best_block_height : u32
1517
1520
) -> ( PendingOutboundPayment , Vec < [ u8 ; 32 ] > )
1518
1521
where
1519
1522
ES :: Target : EntropySource ,
@@ -1534,6 +1537,7 @@ impl OutboundPayments {
1534
1537
payment_secret : recipient_onion. payment_secret ,
1535
1538
payment_metadata : recipient_onion. payment_metadata ,
1536
1539
keysend_preimage,
1540
+ invoice_request,
1537
1541
custom_tlvs : recipient_onion. custom_tlvs ,
1538
1542
starting_block_height : best_block_height,
1539
1543
total_msat : route. get_total_amount ( ) ,
@@ -2091,6 +2095,7 @@ impl_writeable_tlv_based_enum_upgradable!(PendingOutboundPayment,
2091
2095
( 9 , custom_tlvs, optional_vec) ,
2092
2096
( 10 , starting_block_height, required) ,
2093
2097
( 11 , remaining_max_total_routing_fee_msat, option) ,
2098
+ ( 13 , invoice_request, option) ,
2094
2099
( not_written, retry_strategy, ( static_value, None ) ) ,
2095
2100
( not_written, attempts, ( static_value, PaymentAttempts :: new( ) ) ) ,
2096
2101
} ,
0 commit comments