@@ -1315,19 +1315,23 @@ impl OutboundPayments {
1315
1315
debug_assert ! ( false ) ;
1316
1316
return
1317
1317
} ,
1318
- PendingOutboundPayment :: StaticInvoiceReceived {
1319
- payment_hash, keysend_preimage, retry_strategy, ..
1320
- } => {
1321
- let keysend_preimage = Some ( * keysend_preimage) ;
1318
+ PendingOutboundPayment :: StaticInvoiceReceived { .. } => {
1319
+ let ( payment_hash, keysend_preimage, retry_strategy) =
1320
+ if let PendingOutboundPayment :: StaticInvoiceReceived {
1321
+ payment_hash, keysend_preimage, retry_strategy, ..
1322
+ } = payment. remove ( ) {
1323
+ ( payment_hash, keysend_preimage, retry_strategy)
1324
+ } else { debug_assert ! ( false ) ; return } ;
1325
+ let keysend_preimage = Some ( keysend_preimage) ;
1322
1326
let total_amount = route_params. final_value_msat ;
1323
1327
let recipient_onion = RecipientOnionFields :: spontaneous_empty ( ) ;
1324
- let retry_strategy = Some ( * retry_strategy) ;
1328
+ let retry_strategy = Some ( retry_strategy) ;
1325
1329
let payment_params = Some ( route_params. payment_params . clone ( ) ) ;
1326
1330
let ( retryable_payment, onion_session_privs) = self . create_pending_payment (
1327
- * payment_hash, recipient_onion. clone ( ) , keysend_preimage, & route,
1328
- retry_strategy , payment_params, entropy_source, best_block_height
1331
+ payment_hash, recipient_onion. clone ( ) , keysend_preimage, & route, retry_strategy ,
1332
+ payment_params, entropy_source, best_block_height
1329
1333
) ;
1330
- * payment . into_mut ( ) = retryable_payment;
1334
+ outbounds . insert ( payment_id , retryable_payment) ;
1331
1335
( total_amount, recipient_onion, keysend_preimage, onion_session_privs)
1332
1336
} ,
1333
1337
PendingOutboundPayment :: Fulfilled { .. } => {
0 commit comments