@@ -157,9 +157,9 @@ impl_writeable_tlv_based!(RetryableInvoiceRequest, {
157157} ) ;
158158
159159impl PendingOutboundPayment {
160- fn bolt12_invoice ( & self ) -> Option < & PaidInvoice > {
160+ fn bolt12_invoice ( & self ) -> Option < PaidInvoice > {
161161 match self {
162- PendingOutboundPayment :: Retryable { bolt12_invoice, .. } => bolt12_invoice. as_ref ( ) ,
162+ PendingOutboundPayment :: Retryable { bolt12_invoice, .. } => bolt12_invoice. clone ( ) ,
163163 _ => None ,
164164 }
165165 }
@@ -968,7 +968,7 @@ impl OutboundPayments {
968968 }
969969 let invoice = PaidInvoice :: Bolt12Invoice ( invoice. clone ( ) ) ;
970970 self . send_payment_for_bolt12_invoice_internal (
971- payment_id, payment_hash, None , None , Some ( & invoice) , route_params, retry_strategy, router, first_hops,
971+ payment_id, payment_hash, None , None , Some ( invoice) , route_params, retry_strategy, router, first_hops,
972972 inflight_htlcs, entropy_source, node_signer, node_id_lookup, secp_ctx, best_block_height,
973973 logger, pending_events, send_payment_along_path
974974 )
@@ -979,7 +979,7 @@ impl OutboundPayments {
979979 > (
980980 & self , payment_id : PaymentId , payment_hash : PaymentHash ,
981981 keysend_preimage : Option < PaymentPreimage > , invoice_request : Option < & InvoiceRequest > ,
982- bolt12_invoice : Option < & PaidInvoice > ,
982+ bolt12_invoice : Option < PaidInvoice > ,
983983 mut route_params : RouteParameters , retry_strategy : Retry , router : & R ,
984984 first_hops : Vec < ChannelDetails > , inflight_htlcs : IH , entropy_source : & ES , node_signer : & NS ,
985985 node_id_lookup : & NL , secp_ctx : & Secp256k1 < secp256k1:: All > , best_block_height : u32 , logger : & L ,
@@ -1042,7 +1042,7 @@ impl OutboundPayments {
10421042 hash_map:: Entry :: Occupied ( entry) => match entry. get ( ) {
10431043 PendingOutboundPayment :: InvoiceReceived { .. } => {
10441044 let ( retryable_payment, onion_session_privs) = Self :: create_pending_payment (
1045- payment_hash, recipient_onion. clone ( ) , keysend_preimage, None , bolt12_invoice. cloned ( ) , & route,
1045+ payment_hash, recipient_onion. clone ( ) , keysend_preimage, None , bolt12_invoice, & route,
10461046 Some ( retry_strategy) , payment_params, entropy_source, best_block_height,
10471047 ) ;
10481048 * entry. into_mut ( ) = retryable_payment;
@@ -1053,7 +1053,7 @@ impl OutboundPayments {
10531053 invoice_request
10541054 } else { unreachable ! ( ) } ;
10551055 let ( retryable_payment, onion_session_privs) = Self :: create_pending_payment (
1056- payment_hash, recipient_onion. clone ( ) , keysend_preimage, Some ( invreq) , bolt12_invoice. cloned ( ) , & route,
1056+ payment_hash, recipient_onion. clone ( ) , keysend_preimage, Some ( invreq) , bolt12_invoice, & route,
10571057 Some ( retry_strategy) , payment_params, entropy_source, best_block_height
10581058 ) ;
10591059 outbounds. insert ( payment_id, retryable_payment) ;
@@ -2029,7 +2029,7 @@ impl OutboundPayments {
20292029 payment_hash,
20302030 amount_msat,
20312031 fee_paid_msat,
2032- bolt12_invoice : payment. get ( ) . bolt12_invoice ( ) . cloned ( ) ,
2032+ bolt12_invoice : payment. get ( ) . bolt12_invoice ( ) ,
20332033 } , Some ( ev_completion_action. clone ( ) ) ) ) ;
20342034 payment. get_mut ( ) . mark_fulfilled ( ) ;
20352035 }
@@ -2388,7 +2388,7 @@ impl OutboundPayments {
23882388 payment_metadata: None , // only used for retries, and we'll never retry on startup
23892389 keysend_preimage: None , // only used for retries, and we'll never retry on startup
23902390 invoice_request: None , // only used for retries, and we'll never retry on startup
2391- bolt12_invoice: None , // only used for retries, and we'll never retry on startup! TODO(vincenzopalazzo): double check this
2391+ bolt12_invoice: None , // only used for retries, and we'll never retry on startup!
23922392 custom_tlvs: Vec :: new( ) , // only used for retries, and we'll never retry on startup
23932393 pending_amt_msat: path_amt,
23942394 pending_fee_msat: Some ( path_fee) ,
0 commit comments