@@ -95,6 +95,8 @@ pub(crate) enum PendingOutboundPayment {
9595 retry_strategy : Retry ,
9696 route_params : RouteParameters ,
9797 invoice_request : InvoiceRequest ,
98+ // FIXME: we should pass the invoice as a string
99+ static_invoice : String ,
98100 } ,
99101 Retryable {
100102 retry_strategy : Option < Retry > ,
@@ -989,12 +991,19 @@ impl OutboundPayments {
989991 * entry. into_mut ( ) = retryable_payment;
990992 onion_session_privs
991993 } ,
992- PendingOutboundPayment :: StaticInvoiceReceived { .. } => {
994+ PendingOutboundPayment :: StaticInvoiceReceived { static_invoice : _static_invoice , .. } => {
993995 let invreq = if let PendingOutboundPayment :: StaticInvoiceReceived { invoice_request, .. } = entry. remove ( ) {
994996 invoice_request
995997 } else { unreachable ! ( ) } ;
998+
999+ #[ cfg( not( async_payments) ) ]
1000+ let invoice: Option < OfferInvoice > = None ;
1001+ #[ cfg( async_payments) ]
1002+ let invoice = {
1003+ None
1004+ } ;
9961005 let ( retryable_payment, onion_session_privs) = Self :: create_pending_payment (
997- payment_hash, recipient_onion. clone ( ) , keysend_preimage, Some ( invreq) , bolt12_invoice . cloned ( ) , & route,
1006+ payment_hash, recipient_onion. clone ( ) , keysend_preimage, Some ( invreq) , invoice , & route,
9981007 Some ( retry_strategy) , payment_params, entropy_source, best_block_height
9991008 ) ;
10001009 outbounds. insert ( payment_id, retryable_payment) ;
@@ -1092,6 +1101,7 @@ impl OutboundPayments {
10921101 return Err ( Bolt12PaymentError :: SendingFailed ( RetryableSendFailure :: OnionPacketSizeExceeded ) )
10931102 }
10941103
1104+ // Adds the static invoice here?
10951105 * entry. into_mut ( ) = PendingOutboundPayment :: StaticInvoiceReceived {
10961106 payment_hash,
10971107 keysend_preimage,
@@ -1102,6 +1112,7 @@ impl OutboundPayments {
11021112 . take ( )
11031113 . ok_or ( Bolt12PaymentError :: UnexpectedInvoice ) ?
11041114 . invoice_request ,
1115+ static_invoice : String :: from ( "we should have the static invoice here" ) ,
11051116 } ;
11061117 return Ok ( ( ) )
11071118 } ,
@@ -2469,6 +2480,7 @@ impl_writeable_tlv_based_enum_upgradable!(PendingOutboundPayment,
24692480 ( 4 , retry_strategy, required) ,
24702481 ( 6 , route_params, required) ,
24712482 ( 8 , invoice_request, required) ,
2483+ ( 10 , static_invoice, required) ,
24722484 } ,
24732485 // Added in 0.1. Prior versions will drop these outbounds on downgrade, which is safe because
24742486 // no HTLCs are in-flight.
0 commit comments