File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -643,8 +643,14 @@ impl OutboundPayments {
643
643
} else if has_err {
644
644
// If we failed to send any paths, we should remove the new PaymentId from the
645
645
// `pending_outbound_payments` map, as the user isn't expected to `abandon_payment`.
646
- let removed = self . pending_outbound_payments . lock ( ) . unwrap ( ) . remove ( & payment_id) . is_some ( ) ;
647
- debug_assert ! ( removed, "We should always have a pending payment to remove here" ) ;
646
+ if !self . pending_outbound_payments . lock ( ) . unwrap ( ) . get ( & payment_id)
647
+ . map_or ( false , |payment| payment. is_retryable ( ) )
648
+ {
649
+ // If we failed to send any paths, we should remove the new PaymentId from the
650
+ // `pending_outbound_payments` map, as the user isn't expected to `abandon_payment`.
651
+ let removed = self . pending_outbound_payments . lock ( ) . unwrap ( ) . remove ( & payment_id) . is_some ( ) ;
652
+ debug_assert ! ( removed, "We should always have a pending payment to remove here" ) ;
653
+ }
648
654
Err ( PaymentSendFailure :: AllFailedResendSafe ( results. drain ( ..) . map ( |r| r. unwrap_err ( ) ) . collect ( ) ) )
649
655
} else {
650
656
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments