@@ -219,9 +219,13 @@ impl PendingOutboundPayment {
219219 params. insert_previously_failed_blinded_path ( blinded_tail) ;
220220 }
221221 }
222- fn is_awaiting_invoice ( & self ) -> bool {
222+ // Used for payments to BOLT 12 offers where we are either waiting for an invoice or have an
223+ // invoice but have not locked in HTLCs for the payment yet.
224+ fn is_pre_htlc_lock_in ( & self ) -> bool {
223225 match self {
224- PendingOutboundPayment :: AwaitingInvoice { .. } => true ,
226+ PendingOutboundPayment :: AwaitingInvoice { .. }
227+ | PendingOutboundPayment :: InvoiceReceived { .. }
228+ | PendingOutboundPayment :: StaticInvoiceReceived { .. } => true ,
225229 _ => false ,
226230 }
227231 }
@@ -1370,7 +1374,7 @@ impl OutboundPayments {
13701374 let mut retain = true ;
13711375 if !pmt. is_auto_retryable_now ( )
13721376 && pmt. remaining_parts ( ) == 0
1373- && !pmt. is_awaiting_invoice ( )
1377+ && !pmt. is_pre_htlc_lock_in ( )
13741378 {
13751379 pmt. mark_abandoned ( PaymentFailureReason :: RetriesExhausted ) ;
13761380 if let PendingOutboundPayment :: Abandoned { payment_hash, reason, .. } = pmt {
@@ -1398,7 +1402,7 @@ impl OutboundPayments {
13981402 || !pmt. is_auto_retryable_now ( )
13991403 && pmt. remaining_parts ( ) == 0
14001404 && !pmt. is_fulfilled ( )
1401- && !pmt. is_awaiting_invoice ( )
1405+ && !pmt. is_pre_htlc_lock_in ( )
14021406 } )
14031407 }
14041408
0 commit comments