@@ -245,6 +245,10 @@ pub(crate) enum HTLCSource {
245245 first_hop_htlc_msat : u64 ,
246246 payment_id : PaymentId ,
247247 payment_secret : Option < PaymentSecret > ,
248+ /// Note that this is now "deprecated" - we write it for forwards (and read it for
249+ /// backwards) compatibility reasons, but prefer to use the data in the
250+ /// [`super::outbound_payment`] module, which stores per-payment data once instead of in
251+ /// each HTLC.
248252 payment_params : Option < PaymentParameters > ,
249253 } ,
250254}
@@ -2473,7 +2477,7 @@ where
24732477 self . pending_outbound_payments
24742478 . send_payment ( payment_hash, payment_secret, payment_id, retry_strategy, route_params,
24752479 & self . router , self . list_usable_channels ( ) , self . compute_inflight_htlcs ( ) ,
2476- & self . entropy_source , & self . node_signer , best_block_height,
2480+ & self . entropy_source , & self . node_signer , best_block_height, & self . logger ,
24772481 |path, payment_params, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv|
24782482 self . send_payment_along_path ( path, payment_params, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv) )
24792483 }
@@ -2489,7 +2493,7 @@ where
24892493 #[ cfg( test) ]
24902494 pub ( crate ) fn test_add_new_pending_payment ( & self , payment_hash : PaymentHash , payment_secret : Option < PaymentSecret > , payment_id : PaymentId , route : & Route ) -> Result < Vec < [ u8 ; 32 ] > , PaymentSendFailure > {
24912495 let best_block_height = self . best_block . read ( ) . unwrap ( ) . height ( ) ;
2492- self . pending_outbound_payments . test_add_new_pending_payment ( payment_hash, payment_secret, payment_id, route, Retry :: Attempts ( 0 ) , & self . entropy_source , best_block_height)
2496+ self . pending_outbound_payments . test_add_new_pending_payment ( payment_hash, payment_secret, payment_id, route, None , & self . entropy_source , best_block_height)
24932497 }
24942498
24952499
@@ -7357,9 +7361,9 @@ where
73577361 hash_map:: Entry :: Vacant ( entry) => {
73587362 let path_fee = path. get_path_fees ( ) ;
73597363 entry. insert ( PendingOutboundPayment :: Retryable {
7360- retry_strategy : Retry :: Attempts ( 0 ) ,
7364+ retry_strategy : None ,
73617365 attempts : PaymentAttempts :: new ( ) ,
7362- route_params : None ,
7366+ payment_params : None ,
73637367 session_privs : [ session_priv_bytes] . iter ( ) . map ( |a| * a) . collect ( ) ,
73647368 payment_hash : htlc. payment_hash ,
73657369 payment_secret,
@@ -7871,7 +7875,7 @@ mod tests {
78717875
78727876 // Next, attempt a keysend payment and make sure it fails.
78737877 let route_params = RouteParameters {
7874- payment_params : PaymentParameters :: for_keysend ( expected_route. last ( ) . unwrap ( ) . node . get_our_node_id ( ) ) ,
7878+ payment_params : PaymentParameters :: for_keysend ( expected_route. last ( ) . unwrap ( ) . node . get_our_node_id ( ) , TEST_FINAL_CLTV ) ,
78757879 final_value_msat : 100_000 ,
78767880 final_cltv_expiry_delta : TEST_FINAL_CLTV ,
78777881 } ;
@@ -7964,7 +7968,7 @@ mod tests {
79647968
79657969 let _chan = create_chan_between_nodes ( & nodes[ 0 ] , & nodes[ 1 ] ) ;
79667970 let route_params = RouteParameters {
7967- payment_params : PaymentParameters :: for_keysend ( payee_pubkey) ,
7971+ payment_params : PaymentParameters :: for_keysend ( payee_pubkey, 40 ) ,
79687972 final_value_msat : 10_000 ,
79697973 final_cltv_expiry_delta : 40 ,
79707974 } ;
@@ -8009,7 +8013,7 @@ mod tests {
80098013
80108014 let _chan = create_chan_between_nodes ( & nodes[ 0 ] , & nodes[ 1 ] ) ;
80118015 let route_params = RouteParameters {
8012- payment_params : PaymentParameters :: for_keysend ( payee_pubkey) ,
8016+ payment_params : PaymentParameters :: for_keysend ( payee_pubkey, 40 ) ,
80138017 final_value_msat : 10_000 ,
80148018 final_cltv_expiry_delta : 40 ,
80158019 } ;
@@ -8574,7 +8578,7 @@ pub mod bench {
85748578 macro_rules! send_payment {
85758579 ( $node_a: expr, $node_b: expr) => {
85768580 let usable_channels = $node_a. list_usable_channels( ) ;
8577- let payment_params = PaymentParameters :: from_node_id( $node_b. get_our_node_id( ) )
8581+ let payment_params = PaymentParameters :: from_node_id( $node_b. get_our_node_id( ) , TEST_FINAL_CLTV )
85788582 . with_features( $node_b. invoice_features( ) ) ;
85798583 let scorer = test_utils:: TestScorer :: with_penalty( 0 ) ;
85808584 let seed = [ 3u8 ; 32 ] ;
0 commit comments