@@ -219,9 +219,13 @@ impl PendingOutboundPayment {
219
219
params. insert_previously_failed_blinded_path ( blinded_tail) ;
220
220
}
221
221
}
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 {
223
225
match self {
224
- PendingOutboundPayment :: AwaitingInvoice { .. } => true ,
226
+ PendingOutboundPayment :: AwaitingInvoice { .. }
227
+ | PendingOutboundPayment :: InvoiceReceived { .. }
228
+ | PendingOutboundPayment :: StaticInvoiceReceived { .. } => true ,
225
229
_ => false ,
226
230
}
227
231
}
@@ -1370,7 +1374,7 @@ impl OutboundPayments {
1370
1374
let mut retain = true ;
1371
1375
if !pmt. is_auto_retryable_now ( )
1372
1376
&& pmt. remaining_parts ( ) == 0
1373
- && !pmt. is_awaiting_invoice ( )
1377
+ && !pmt. is_pre_htlc_lock_in ( )
1374
1378
{
1375
1379
pmt. mark_abandoned ( PaymentFailureReason :: RetriesExhausted ) ;
1376
1380
if let PendingOutboundPayment :: Abandoned { payment_hash, reason, .. } = pmt {
@@ -1398,7 +1402,7 @@ impl OutboundPayments {
1398
1402
|| !pmt. is_auto_retryable_now ( )
1399
1403
&& pmt. remaining_parts ( ) == 0
1400
1404
&& !pmt. is_fulfilled ( )
1401
- && !pmt. is_awaiting_invoice ( )
1405
+ && !pmt. is_pre_htlc_lock_in ( )
1402
1406
} )
1403
1407
}
1404
1408
0 commit comments