@@ -245,6 +245,10 @@ pub(crate) enum HTLCSource {
245
245
first_hop_htlc_msat : u64 ,
246
246
payment_id : PaymentId ,
247
247
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.
248
252
payment_params : Option < PaymentParameters > ,
249
253
} ,
250
254
}
@@ -2473,7 +2477,7 @@ where
2473
2477
self . pending_outbound_payments
2474
2478
. send_payment ( payment_hash, payment_secret, payment_id, retry_strategy, route_params,
2475
2479
& 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 ,
2477
2481
|path, payment_params, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv|
2478
2482
self . send_payment_along_path ( path, payment_params, payment_hash, payment_secret, total_value, cur_height, payment_id, keysend_preimage, session_priv) )
2479
2483
}
@@ -2489,7 +2493,7 @@ where
2489
2493
#[ cfg( test) ]
2490
2494
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 > {
2491
2495
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)
2493
2497
}
2494
2498
2495
2499
@@ -7357,9 +7361,9 @@ where
7357
7361
hash_map:: Entry :: Vacant ( entry) => {
7358
7362
let path_fee = path. get_path_fees ( ) ;
7359
7363
entry. insert ( PendingOutboundPayment :: Retryable {
7360
- retry_strategy : Retry :: Attempts ( 0 ) ,
7364
+ retry_strategy : None ,
7361
7365
attempts : PaymentAttempts :: new ( ) ,
7362
- route_params : None ,
7366
+ payment_params : None ,
7363
7367
session_privs : [ session_priv_bytes] . iter ( ) . map ( |a| * a) . collect ( ) ,
7364
7368
payment_hash : htlc. payment_hash ,
7365
7369
payment_secret,
@@ -7871,7 +7875,7 @@ mod tests {
7871
7875
7872
7876
// Next, attempt a keysend payment and make sure it fails.
7873
7877
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 ) ,
7875
7879
final_value_msat : 100_000 ,
7876
7880
final_cltv_expiry_delta : TEST_FINAL_CLTV ,
7877
7881
} ;
@@ -7964,7 +7968,7 @@ mod tests {
7964
7968
7965
7969
let _chan = create_chan_between_nodes ( & nodes[ 0 ] , & nodes[ 1 ] ) ;
7966
7970
let route_params = RouteParameters {
7967
- payment_params : PaymentParameters :: for_keysend ( payee_pubkey) ,
7971
+ payment_params : PaymentParameters :: for_keysend ( payee_pubkey, 40 ) ,
7968
7972
final_value_msat : 10_000 ,
7969
7973
final_cltv_expiry_delta : 40 ,
7970
7974
} ;
@@ -8009,7 +8013,7 @@ mod tests {
8009
8013
8010
8014
let _chan = create_chan_between_nodes ( & nodes[ 0 ] , & nodes[ 1 ] ) ;
8011
8015
let route_params = RouteParameters {
8012
- payment_params : PaymentParameters :: for_keysend ( payee_pubkey) ,
8016
+ payment_params : PaymentParameters :: for_keysend ( payee_pubkey, 40 ) ,
8013
8017
final_value_msat : 10_000 ,
8014
8018
final_cltv_expiry_delta : 40 ,
8015
8019
} ;
@@ -8574,7 +8578,7 @@ pub mod bench {
8574
8578
macro_rules! send_payment {
8575
8579
( $node_a: expr, $node_b: expr) => {
8576
8580
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 )
8578
8582
. with_features( $node_b. invoice_features( ) ) ;
8579
8583
let scorer = test_utils:: TestScorer :: with_penalty( 0 ) ;
8580
8584
let seed = [ 3u8 ; 32 ] ;
0 commit comments