@@ -868,9 +868,11 @@ impl OutboundPayments {
868
868
// is already updated at the time the invoice is received. This ensures that `InvoiceReceived`
869
869
// event generation remains idempotent, even if the same invoice is received again before the
870
870
// current one is handled by the user.
871
- if !with_manual_handling { self . mark_invoice_received ( payment_id, payment_hash) ? }
872
-
873
- let ( retry_strategy, params_config) = self . received_invoice_details ( payment_id) ?;
871
+ let ( retry_strategy, params_config) = if with_manual_handling {
872
+ self . received_invoice_details ( payment_id) ?
873
+ } else {
874
+ self . mark_invoice_received_and_get_details ( payment_id, payment_hash) ?
875
+ } ;
874
876
875
877
if invoice. invoice_features ( ) . requires_unknown_bits_from ( & features) {
876
878
self . abandon_payment (
@@ -1778,21 +1780,23 @@ impl OutboundPayments {
1778
1780
}
1779
1781
}
1780
1782
1781
- pub ( super ) fn mark_invoice_received (
1783
+ pub ( super ) fn mark_invoice_received_and_get_details (
1782
1784
& self , payment_id : PaymentId , payment_hash : PaymentHash
1783
- ) -> Result < ( ) , Bolt12PaymentError > {
1785
+ ) -> Result < ( Retry , RouteParametersConfig ) , Bolt12PaymentError > {
1784
1786
match self . pending_outbound_payments . lock ( ) . unwrap ( ) . entry ( payment_id) {
1785
1787
hash_map:: Entry :: Occupied ( entry) => match entry. get ( ) {
1786
1788
PendingOutboundPayment :: AwaitingInvoice {
1787
1789
retry_strategy : retry, route_params_config, ..
1788
1790
} => {
1791
+ let retry = * retry;
1792
+ let config = * route_params_config;
1789
1793
* entry. into_mut ( ) = PendingOutboundPayment :: InvoiceReceived {
1790
1794
payment_hash,
1791
- retry_strategy : * retry,
1792
- route_params_config : * route_params_config ,
1795
+ retry_strategy : retry,
1796
+ route_params_config : config ,
1793
1797
} ;
1794
1798
1795
- Ok ( ( ) )
1799
+ Ok ( ( retry , config ) )
1796
1800
} ,
1797
1801
_ => Err ( Bolt12PaymentError :: DuplicateInvoice ) ,
1798
1802
} ,
0 commit comments