@@ -1802,7 +1802,7 @@ fn test_channel_reserve_holding_cell_htlcs() {
18021802
18031803 // attempt to send amt_msat > their_max_htlc_value_in_flight_msat
18041804 {
1805- let payment_params = PaymentParameters :: from_node_id ( nodes[ 2 ] . node . get_our_node_id ( ) )
1805+ let payment_params = PaymentParameters :: from_node_id ( nodes[ 2 ] . node . get_our_node_id ( ) , TEST_FINAL_CLTV )
18061806 . with_features ( nodes[ 2 ] . node . invoice_features ( ) ) . with_max_channel_saturation_power_of_half ( 0 ) ;
18071807 let ( mut route, our_payment_hash, _, our_payment_secret) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , payment_params, recv_value_0, TEST_FINAL_CLTV ) ;
18081808 route. paths [ 0 ] . last_mut ( ) . unwrap ( ) . fee_msat += 1 ;
@@ -1827,7 +1827,7 @@ fn test_channel_reserve_holding_cell_htlcs() {
18271827 break ;
18281828 }
18291829
1830- let payment_params = PaymentParameters :: from_node_id ( nodes[ 2 ] . node . get_our_node_id ( ) )
1830+ let payment_params = PaymentParameters :: from_node_id ( nodes[ 2 ] . node . get_our_node_id ( ) , TEST_FINAL_CLTV )
18311831 . with_features ( nodes[ 2 ] . node . invoice_features ( ) ) . with_max_channel_saturation_power_of_half ( 0 ) ;
18321832 let route = get_route ! ( nodes[ 0 ] , payment_params, recv_value_0, TEST_FINAL_CLTV ) . unwrap ( ) ;
18331833 let ( payment_preimage, ..) = send_along_route ( & nodes[ 0 ] , route, & [ & nodes[ 1 ] , & nodes[ 2 ] ] , recv_value_0) ;
@@ -4716,7 +4716,7 @@ fn test_duplicate_payment_hash_one_failure_one_success() {
47164716 // We reduce the final CLTV here by a somewhat arbitrary constant to keep it under the one-byte
47174717 // script push size limit so that the below script length checks match
47184718 // ACCEPTED_HTLC_SCRIPT_WEIGHT.
4719- let payment_params = PaymentParameters :: from_node_id ( nodes[ 3 ] . node . get_our_node_id ( ) )
4719+ let payment_params = PaymentParameters :: from_node_id ( nodes[ 3 ] . node . get_our_node_id ( ) , TEST_FINAL_CLTV - 40 )
47204720 . with_features ( nodes[ 3 ] . node . invoice_features ( ) ) ;
47214721 let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 3 ] , payment_params, 800_000 , TEST_FINAL_CLTV - 40 ) ;
47224722 send_along_route_with_secret ( & nodes[ 0 ] , route, & [ & [ & nodes[ 1 ] , & nodes[ 2 ] , & nodes[ 3 ] ] ] , 800_000 , duplicate_payment_hash, payment_secret) ;
@@ -6009,7 +6009,7 @@ fn test_update_add_htlc_bolt2_sender_cltv_expiry_too_high() {
60096009 let mut nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
60106010 let _chan = create_announced_chan_between_nodes_with_value ( & nodes, 0 , 1 , 1000000 , 0 ) ;
60116011
6012- let payment_params = PaymentParameters :: from_node_id ( nodes[ 1 ] . node . get_our_node_id ( ) )
6012+ let payment_params = PaymentParameters :: from_node_id ( nodes[ 1 ] . node . get_our_node_id ( ) , 0 )
60136013 . with_features ( nodes[ 1 ] . node . invoice_features ( ) ) ;
60146014 let ( mut route, our_payment_hash, _, our_payment_secret) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , payment_params, 100000000 , 0 ) ;
60156015 route. paths [ 0 ] . last_mut ( ) . unwrap ( ) . cltv_expiry_delta = 500000001 ;
@@ -6927,7 +6927,7 @@ fn test_check_htlc_underpaying() {
69276927
69286928 let scorer = test_utils:: TestScorer :: with_penalty ( 0 ) ;
69296929 let random_seed_bytes = chanmon_cfgs[ 1 ] . keys_manager . get_secure_random_bytes ( ) ;
6930- let payment_params = PaymentParameters :: from_node_id ( nodes[ 1 ] . node . get_our_node_id ( ) ) . with_features ( nodes[ 1 ] . node . invoice_features ( ) ) ;
6930+ let payment_params = PaymentParameters :: from_node_id ( nodes[ 1 ] . node . get_our_node_id ( ) , TEST_FINAL_CLTV ) . with_features ( nodes[ 1 ] . node . invoice_features ( ) ) ;
69316931 let route = get_route ( & nodes[ 0 ] . node . get_our_node_id ( ) , & payment_params, & nodes[ 0 ] . network_graph . read_only ( ) , None , 10_000 , TEST_FINAL_CLTV , nodes[ 0 ] . logger , & scorer, & random_seed_bytes) . unwrap ( ) ;
69326932 let ( _, our_payment_hash, _) = get_payment_preimage_hash ! ( nodes[ 0 ] ) ;
69336933 let our_payment_secret = nodes[ 1 ] . node . create_inbound_payment_for_hash ( our_payment_hash, Some ( 100_000 ) , 7200 , None ) . unwrap ( ) ;
@@ -7068,7 +7068,7 @@ fn test_bump_penalty_txn_on_revoked_commitment() {
70687068 let chan = create_announced_chan_between_nodes_with_value ( & nodes, 0 , 1 , 1000000 , 59000000 ) ;
70697069
70707070 let payment_preimage = route_payment ( & nodes[ 0 ] , & vec ! ( & nodes[ 1 ] ) [ ..] , 3000000 ) . 0 ;
7071- let payment_params = PaymentParameters :: from_node_id ( nodes[ 0 ] . node . get_our_node_id ( ) )
7071+ let payment_params = PaymentParameters :: from_node_id ( nodes[ 0 ] . node . get_our_node_id ( ) , 30 )
70727072 . with_features ( nodes[ 0 ] . node . invoice_features ( ) ) ;
70737073 let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 1 ] , nodes[ 0 ] , payment_params, 3000000 , 30 ) ;
70747074 send_along_route ( & nodes[ 1 ] , route, & vec ! ( & nodes[ 0 ] ) [ ..] , 3000000 ) ;
@@ -7174,13 +7174,13 @@ fn test_bump_penalty_txn_on_revoked_htlcs() {
71747174
71757175 let chan = create_announced_chan_between_nodes_with_value ( & nodes, 0 , 1 , 1000000 , 59000000 ) ;
71767176 // Lock HTLC in both directions (using a slightly lower CLTV delay to provide timely RBF bumps)
7177- let payment_params = PaymentParameters :: from_node_id ( nodes[ 1 ] . node . get_our_node_id ( ) ) . with_features ( nodes[ 1 ] . node . invoice_features ( ) ) ;
7177+ let payment_params = PaymentParameters :: from_node_id ( nodes[ 1 ] . node . get_our_node_id ( ) , 50 ) . with_features ( nodes[ 1 ] . node . invoice_features ( ) ) ;
71787178 let scorer = test_utils:: TestScorer :: with_penalty ( 0 ) ;
71797179 let random_seed_bytes = chanmon_cfgs[ 1 ] . keys_manager . get_secure_random_bytes ( ) ;
71807180 let route = get_route ( & nodes[ 0 ] . node . get_our_node_id ( ) , & payment_params, & nodes[ 0 ] . network_graph . read_only ( ) , None ,
71817181 3_000_000 , 50 , nodes[ 0 ] . logger , & scorer, & random_seed_bytes) . unwrap ( ) ;
71827182 let payment_preimage = send_along_route ( & nodes[ 0 ] , route, & [ & nodes[ 1 ] ] , 3_000_000 ) . 0 ;
7183- let payment_params = PaymentParameters :: from_node_id ( nodes[ 0 ] . node . get_our_node_id ( ) ) . with_features ( nodes[ 0 ] . node . invoice_features ( ) ) ;
7183+ let payment_params = PaymentParameters :: from_node_id ( nodes[ 0 ] . node . get_our_node_id ( ) , 50 ) . with_features ( nodes[ 0 ] . node . invoice_features ( ) ) ;
71847184 let route = get_route ( & nodes[ 1 ] . node . get_our_node_id ( ) , & payment_params, & nodes[ 1 ] . network_graph . read_only ( ) , None ,
71857185 3_000_000 , 50 , nodes[ 0 ] . logger , & scorer, & random_seed_bytes) . unwrap ( ) ;
71867186 send_along_route ( & nodes[ 1 ] , route, & [ & nodes[ 0 ] ] , 3_000_000 ) ;
@@ -8976,7 +8976,7 @@ fn do_test_dup_htlc_second_rejected(test_for_second_fail_panic: bool) {
89768976
89778977 let _chan = create_announced_chan_between_nodes_with_value ( & nodes, 0 , 1 , 100000 , 10001 ) ;
89788978
8979- let payment_params = PaymentParameters :: from_node_id ( nodes[ 1 ] . node . get_our_node_id ( ) )
8979+ let payment_params = PaymentParameters :: from_node_id ( nodes[ 1 ] . node . get_our_node_id ( ) , TEST_FINAL_CLTV )
89808980 . with_features ( nodes[ 1 ] . node . invoice_features ( ) ) ;
89818981 let route = get_route ! ( nodes[ 0 ] , payment_params, 10_000 , TEST_FINAL_CLTV ) . unwrap ( ) ;
89828982
@@ -9081,7 +9081,7 @@ fn test_inconsistent_mpp_params() {
90819081 create_announced_chan_between_nodes_with_value ( & nodes, 1 , 3 , 100_000 , 0 ) ;
90829082 let chan_2_3 =create_announced_chan_between_nodes_with_value ( & nodes, 2 , 3 , 100_000 , 0 ) ;
90839083
9084- let payment_params = PaymentParameters :: from_node_id ( nodes[ 3 ] . node . get_our_node_id ( ) )
9084+ let payment_params = PaymentParameters :: from_node_id ( nodes[ 3 ] . node . get_our_node_id ( ) , TEST_FINAL_CLTV )
90859085 . with_features ( nodes[ 3 ] . node . invoice_features ( ) ) ;
90869086 let mut route = get_route ! ( nodes[ 0 ] , payment_params, 15_000_000 , TEST_FINAL_CLTV ) . unwrap ( ) ;
90879087 assert_eq ! ( route. paths. len( ) , 2 ) ;
@@ -9182,7 +9182,7 @@ fn test_keysend_payments_to_public_node() {
91829182 let payer_pubkey = nodes[ 0 ] . node . get_our_node_id ( ) ;
91839183 let payee_pubkey = nodes[ 1 ] . node . get_our_node_id ( ) ;
91849184 let route_params = RouteParameters {
9185- payment_params : PaymentParameters :: for_keysend ( payee_pubkey) ,
9185+ payment_params : PaymentParameters :: for_keysend ( payee_pubkey, 40 ) ,
91869186 final_value_msat : 10000 ,
91879187 final_cltv_expiry_delta : 40 ,
91889188 } ;
@@ -9215,7 +9215,7 @@ fn test_keysend_payments_to_private_node() {
92159215
92169216 let _chan = create_chan_between_nodes ( & nodes[ 0 ] , & nodes[ 1 ] ) ;
92179217 let route_params = RouteParameters {
9218- payment_params : PaymentParameters :: for_keysend ( payee_pubkey) ,
9218+ payment_params : PaymentParameters :: for_keysend ( payee_pubkey, 40 ) ,
92199219 final_value_msat : 10000 ,
92209220 final_cltv_expiry_delta : 40 ,
92219221 } ;
@@ -9603,7 +9603,7 @@ fn do_payment_with_custom_min_final_cltv_expiry(valid_delta: bool, use_user_hash
96039603
96049604 create_chan_between_nodes ( & nodes[ 0 ] , & nodes[ 1 ] ) ;
96059605
9606- let payment_parameters = PaymentParameters :: from_node_id ( nodes[ 1 ] . node . get_our_node_id ( ) ) ;
9606+ let payment_parameters = PaymentParameters :: from_node_id ( nodes[ 1 ] . node . get_our_node_id ( ) , final_cltv_expiry_delta as u32 ) ;
96079607 let ( payment_hash, payment_preimage, payment_secret) = if use_user_hash {
96089608 let ( payment_preimage, payment_hash, payment_secret) = get_payment_preimage_hash ! ( nodes[ 1 ] ,
96099609 Some ( recv_value) , Some ( min_final_cltv_expiry_delta) ) ;
0 commit comments