@@ -12325,17 +12325,11 @@ where
12325
12325
&self, offer: &Offer, amount_msats: Option<u64>, payment_id: PaymentId,
12326
12326
optional_params: OptionalOfferPaymentParams,
12327
12327
) -> Result<(), Bolt12SemanticError> {
12328
- let create_pending_payment_fn = |invoice_request: &InvoiceRequest, nonce| {
12329
- let expiration = StaleExpiration::TimerTicks(1);
12330
- let retryable_invoice_request = RetryableInvoiceRequest {
12331
- invoice_request: invoice_request.clone(),
12332
- nonce,
12333
- needs_retry: true,
12334
- };
12328
+ let create_pending_payment_fn = |retryable_invoice_request: RetryableInvoiceRequest| {
12335
12329
self.pending_outbound_payments
12336
12330
.add_new_awaiting_invoice(
12337
12331
payment_id,
12338
- expiration ,
12332
+ StaleExpiration::TimerTicks(1) ,
12339
12333
optional_params.retry_strategy,
12340
12334
optional_params.route_params_config,
12341
12335
Some(retryable_invoice_request),
@@ -12360,17 +12354,11 @@ where
12360
12354
&self, offer: &OfferFromHrn, amount_msats: u64, payment_id: PaymentId,
12361
12355
optional_params: OptionalOfferPaymentParams,
12362
12356
) -> Result<(), Bolt12SemanticError> {
12363
- let create_pending_payment_fn = |invoice_request: &InvoiceRequest, nonce| {
12364
- let expiration = StaleExpiration::TimerTicks(1);
12365
- let retryable_invoice_request = RetryableInvoiceRequest {
12366
- invoice_request: invoice_request.clone(),
12367
- nonce,
12368
- needs_retry: true,
12369
- };
12357
+ let create_pending_payment_fn = |retryable_invoice_request: RetryableInvoiceRequest| {
12370
12358
self.pending_outbound_payments
12371
12359
.add_new_awaiting_invoice(
12372
12360
payment_id,
12373
- expiration ,
12361
+ StaleExpiration::TimerTicks(1) ,
12374
12362
optional_params.retry_strategy,
12375
12363
optional_params.route_params_config,
12376
12364
Some(retryable_invoice_request),
@@ -12408,17 +12396,11 @@ where
12408
12396
&self, offer: &Offer, amount_msats: Option<u64>, payment_id: PaymentId,
12409
12397
optional_params: OptionalOfferPaymentParams, quantity: u64,
12410
12398
) -> Result<(), Bolt12SemanticError> {
12411
- let create_pending_payment_fn = |invoice_request: &InvoiceRequest, nonce| {
12412
- let expiration = StaleExpiration::TimerTicks(1);
12413
- let retryable_invoice_request = RetryableInvoiceRequest {
12414
- invoice_request: invoice_request.clone(),
12415
- nonce,
12416
- needs_retry: true,
12417
- };
12399
+ let create_pending_payment_fn = |retryable_invoice_request: RetryableInvoiceRequest| {
12418
12400
self.pending_outbound_payments
12419
12401
.add_new_awaiting_invoice(
12420
12402
payment_id,
12421
- expiration ,
12403
+ StaleExpiration::TimerTicks(1) ,
12422
12404
optional_params.retry_strategy,
12423
12405
optional_params.route_params_config,
12424
12406
Some(retryable_invoice_request),
@@ -12438,7 +12420,7 @@ where
12438
12420
}
12439
12421
12440
12422
#[rustfmt::skip]
12441
- fn pay_for_offer_intern<CPP: FnOnce(&InvoiceRequest, Nonce ) -> Result<(), Bolt12SemanticError>>(
12423
+ fn pay_for_offer_intern<CPP: FnOnce(RetryableInvoiceRequest ) -> Result<(), Bolt12SemanticError>>(
12442
12424
&self, offer: &Offer, quantity: Option<u64>, amount_msats: Option<u64>,
12443
12425
payer_note: Option<String>, payment_id: PaymentId,
12444
12426
human_readable_name: Option<HumanReadableName>, create_pending_payment: CPP,
@@ -12475,7 +12457,13 @@ where
12475
12457
self.get_peers_for_blinded_path()
12476
12458
)?;
12477
12459
12478
- create_pending_payment(&invoice_request, nonce)
12460
+ let retryable_invoice_request = RetryableInvoiceRequest {
12461
+ invoice_request: invoice_request.clone(),
12462
+ nonce,
12463
+ needs_retry: true,
12464
+ };
12465
+
12466
+ create_pending_payment(retryable_invoice_request)
12479
12467
}
12480
12468
12481
12469
/// Creates a [`Bolt12Invoice`] for a [`Refund`] and enqueues it to be sent via an onion
@@ -14896,12 +14884,7 @@ where
14896
14884
if let Ok((amt_msats, payer_note)) = self.pending_outbound_payments.params_for_payment_awaiting_offer(payment_id) {
14897
14885
let offer_pay_res =
14898
14886
self.pay_for_offer_intern(&offer, None, Some(amt_msats), payer_note, payment_id, Some(name),
14899
- |invoice_request, nonce| {
14900
- let retryable_invoice_request = RetryableInvoiceRequest {
14901
- invoice_request: invoice_request.clone(),
14902
- nonce,
14903
- needs_retry: true,
14904
- };
14887
+ |retryable_invoice_request| {
14905
14888
self.pending_outbound_payments
14906
14889
.received_offer(payment_id, Some(retryable_invoice_request))
14907
14890
.map_err(|_| Bolt12SemanticError::DuplicatePaymentId)
0 commit comments