@@ -2408,12 +2408,12 @@ where
2408
2408
}
2409
2409
2410
2410
#[ cfg( test) ]
2411
- pub ( crate ) fn test_send_payment_along_path ( & self , path : & Vec < RouteHop > , payment_params : & Option < PaymentParameters > , payment_hash : & PaymentHash , payment_secret : & Option < PaymentSecret > , total_value : u64 , cur_height : u32 , payment_id : PaymentId , keysend_preimage : & Option < PaymentPreimage > , session_priv_bytes : [ u8 ; 32 ] ) -> Result < ( ) , APIError > {
2411
+ pub ( crate ) fn test_send_payment_along_path ( & self , path : & Vec < RouteHop > , payment_hash : & PaymentHash , payment_secret : & Option < PaymentSecret > , total_value : u64 , cur_height : u32 , payment_id : PaymentId , keysend_preimage : & Option < PaymentPreimage > , session_priv_bytes : [ u8 ; 32 ] ) -> Result < ( ) , APIError > {
2412
2412
let _lck = self . total_consistency_lock . read ( ) . unwrap ( ) ;
2413
- self . send_payment_along_path ( path, payment_params , payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv_bytes)
2413
+ self . send_payment_along_path ( path, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv_bytes)
2414
2414
}
2415
2415
2416
- fn send_payment_along_path ( & self , path : & Vec < RouteHop > , payment_params : & Option < PaymentParameters > , payment_hash : & PaymentHash , payment_secret : & Option < PaymentSecret > , total_value : u64 , cur_height : u32 , payment_id : PaymentId , keysend_preimage : & Option < PaymentPreimage > , session_priv_bytes : [ u8 ; 32 ] ) -> Result < ( ) , APIError > {
2416
+ fn send_payment_along_path ( & self , path : & Vec < RouteHop > , payment_hash : & PaymentHash , payment_secret : & Option < PaymentSecret > , total_value : u64 , cur_height : u32 , payment_id : PaymentId , keysend_preimage : & Option < PaymentPreimage > , session_priv_bytes : [ u8 ; 32 ] ) -> Result < ( ) , APIError > {
2417
2417
// The top-level caller should hold the total_consistency_lock read lock.
2418
2418
debug_assert ! ( self . total_consistency_lock. try_write( ) . is_err( ) ) ;
2419
2419
@@ -2557,8 +2557,8 @@ where
2557
2557
let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
2558
2558
self . pending_outbound_payments
2559
2559
. send_payment_with_route ( route, payment_hash, payment_secret, payment_id, & self . entropy_source , & self . node_signer , best_block_height,
2560
- |path, payment_params , payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv|
2561
- self . send_payment_along_path ( path, payment_params , payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv) )
2560
+ |path, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv|
2561
+ self . send_payment_along_path ( path, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv) )
2562
2562
}
2563
2563
2564
2564
/// Similar to [`ChannelManager::send_payment`], but will automatically find a route based on
@@ -2571,17 +2571,17 @@ where
2571
2571
& self . router , self . list_usable_channels ( ) , || self . compute_inflight_htlcs ( ) ,
2572
2572
& self . entropy_source , & self . node_signer , best_block_height, & self . logger ,
2573
2573
& self . pending_events ,
2574
- |path, payment_params , payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv|
2575
- self . send_payment_along_path ( path, payment_params , payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv) )
2574
+ |path, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv|
2575
+ self . send_payment_along_path ( path, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv) )
2576
2576
}
2577
2577
2578
2578
#[ cfg( test) ]
2579
2579
fn test_send_payment_internal ( & self , route : & Route , payment_hash : PaymentHash , payment_secret : & Option < PaymentSecret > , keysend_preimage : Option < PaymentPreimage > , payment_id : PaymentId , recv_value_msat : Option < u64 > , onion_session_privs : Vec < [ u8 ; 32 ] > ) -> Result < ( ) , PaymentSendFailure > {
2580
2580
let best_block_height = self . best_block . read ( ) . unwrap ( ) . height ( ) ;
2581
2581
let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
2582
2582
self . pending_outbound_payments . test_send_payment_internal ( route, payment_hash, payment_secret, keysend_preimage, payment_id, recv_value_msat, onion_session_privs, & self . node_signer , best_block_height,
2583
- |path, payment_params , payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv|
2584
- self . send_payment_along_path ( path, payment_params , payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv) )
2583
+ |path, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv|
2584
+ self . send_payment_along_path ( path, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv) )
2585
2585
}
2586
2586
2587
2587
#[ cfg( test) ]
@@ -2633,8 +2633,8 @@ where
2633
2633
self . pending_outbound_payments . send_spontaneous_payment_with_route (
2634
2634
route, payment_preimage, payment_id, & self . entropy_source , & self . node_signer ,
2635
2635
best_block_height,
2636
- |path, payment_params , payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv|
2637
- self . send_payment_along_path ( path, payment_params , payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv) )
2636
+ |path, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv|
2637
+ self . send_payment_along_path ( path, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv) )
2638
2638
}
2639
2639
2640
2640
/// Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
@@ -2651,8 +2651,8 @@ where
2651
2651
retry_strategy, route_params, & self . router , self . list_usable_channels ( ) ,
2652
2652
|| self . compute_inflight_htlcs ( ) , & self . entropy_source , & self . node_signer , best_block_height,
2653
2653
& self . logger , & self . pending_events ,
2654
- |path, payment_params , payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv|
2655
- self . send_payment_along_path ( path, payment_params , payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv) )
2654
+ |path, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv|
2655
+ self . send_payment_along_path ( path, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv) )
2656
2656
}
2657
2657
2658
2658
/// Send a payment that is probing the given route for liquidity. We calculate the
@@ -2662,8 +2662,8 @@ where
2662
2662
let best_block_height = self . best_block . read ( ) . unwrap ( ) . height ( ) ;
2663
2663
let _persistence_guard = PersistenceNotifierGuard :: notify_on_drop ( & self . total_consistency_lock , & self . persistence_notifier ) ;
2664
2664
self . pending_outbound_payments . send_probe ( hops, self . probing_cookie_secret , & self . entropy_source , & self . node_signer , best_block_height,
2665
- |path, payment_params , payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv|
2666
- self . send_payment_along_path ( path, payment_params , payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv) )
2665
+ |path, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv|
2666
+ self . send_payment_along_path ( path, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv) )
2667
2667
}
2668
2668
2669
2669
/// Returns whether a payment with the given [`PaymentHash`] and [`PaymentId`] is, in fact, a
@@ -3387,8 +3387,8 @@ where
3387
3387
self . pending_outbound_payments . check_retry_payments ( & self . router , || self . list_usable_channels ( ) ,
3388
3388
|| self . compute_inflight_htlcs ( ) , & self . entropy_source , & self . node_signer , best_block_height,
3389
3389
& self . pending_events , & self . logger ,
3390
- |path, payment_params , payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv|
3391
- self . send_payment_along_path ( path, payment_params , payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv) ) ;
3390
+ |path, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv|
3391
+ self . send_payment_along_path ( path, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv) ) ;
3392
3392
3393
3393
for ( htlc_source, payment_hash, failure_reason, destination) in failed_forwards. drain ( ..) {
3394
3394
self . fail_htlc_backwards_internal ( & htlc_source, & payment_hash, & failure_reason, destination) ;
@@ -7876,7 +7876,7 @@ mod tests {
7876
7876
// indicates there are more HTLCs coming.
7877
7877
let cur_height = CHAN_CONFIRM_DEPTH + 1 ; // route_payment calls send_payment, which adds 1 to the current height. So we do the same here to match.
7878
7878
let session_privs = nodes[ 0 ] . node . test_add_new_pending_payment ( our_payment_hash, Some ( payment_secret) , payment_id, & mpp_route) . unwrap ( ) ;
7879
- nodes[ 0 ] . node . test_send_payment_along_path ( & mpp_route. paths [ 0 ] , & route . payment_params , & our_payment_hash, & Some ( payment_secret) , 200_000 , cur_height, payment_id, & None , session_privs[ 0 ] ) . unwrap ( ) ;
7879
+ nodes[ 0 ] . node . test_send_payment_along_path ( & mpp_route. paths [ 0 ] , & our_payment_hash, & Some ( payment_secret) , 200_000 , cur_height, payment_id, & None , session_privs[ 0 ] ) . unwrap ( ) ;
7880
7880
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
7881
7881
let mut events = nodes[ 0 ] . node . get_and_clear_pending_msg_events ( ) ;
7882
7882
assert_eq ! ( events. len( ) , 1 ) ;
@@ -7906,7 +7906,7 @@ mod tests {
7906
7906
expect_payment_failed ! ( nodes[ 0 ] , our_payment_hash, true ) ;
7907
7907
7908
7908
// Send the second half of the original MPP payment.
7909
- nodes[ 0 ] . node . test_send_payment_along_path ( & mpp_route. paths [ 1 ] , & route . payment_params , & our_payment_hash, & Some ( payment_secret) , 200_000 , cur_height, payment_id, & None , session_privs[ 1 ] ) . unwrap ( ) ;
7909
+ nodes[ 0 ] . node . test_send_payment_along_path ( & mpp_route. paths [ 1 ] , & our_payment_hash, & Some ( payment_secret) , 200_000 , cur_height, payment_id, & None , session_privs[ 1 ] ) . unwrap ( ) ;
7910
7910
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
7911
7911
let mut events = nodes[ 0 ] . node . get_and_clear_pending_msg_events ( ) ;
7912
7912
assert_eq ! ( events. len( ) , 1 ) ;
0 commit comments