@@ -1240,7 +1240,7 @@ fn test_duplicate_htlc_different_direction_onchain() {
1240
1240
let ( payment_preimage, payment_hash, _) = route_payment ( & nodes[ 0 ] , & vec ! ( & nodes[ 1 ] ) [ ..] , 900_000 ) ;
1241
1241
1242
1242
let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 1 ] , nodes[ 0 ] , 800_000 ) ;
1243
- let node_a_payment_secret = nodes[ 0 ] . node . create_inbound_payment_for_hash ( payment_hash, None , 7200 ) . unwrap ( ) ;
1243
+ let node_a_payment_secret = nodes[ 0 ] . node . create_inbound_payment_for_hash ( payment_hash, None , 7200 , None ) . unwrap ( ) ;
1244
1244
send_along_route_with_secret ( & nodes[ 1 ] , route, & [ & [ & nodes[ 0 ] ] ] , 800_000 , payment_hash, node_a_payment_secret) ;
1245
1245
1246
1246
// Provide preimage to node 0 by claiming payment
@@ -4727,7 +4727,7 @@ fn test_duplicate_payment_hash_one_failure_one_success() {
4727
4727
4728
4728
let ( our_payment_preimage, duplicate_payment_hash, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , 900_000 ) ;
4729
4729
4730
- let payment_secret = nodes[ 3 ] . node . create_inbound_payment_for_hash ( duplicate_payment_hash, None , 7200 ) . unwrap ( ) ;
4730
+ let payment_secret = nodes[ 3 ] . node . create_inbound_payment_for_hash ( duplicate_payment_hash, None , 7200 , None ) . unwrap ( ) ;
4731
4731
// We reduce the final CLTV here by a somewhat arbitrary constant to keep it under the one-byte
4732
4732
// script push size limit so that the below script length checks match
4733
4733
// ACCEPTED_HTLC_SCRIPT_WEIGHT.
@@ -4945,30 +4945,30 @@ fn do_test_fail_backwards_unrevoked_remote_announce(deliver_last_raa: bool, anno
4945
4945
let ( _, payment_hash_2, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 4 ] ] , ds_dust_limit* 1000 ) ; // not added < dust limit + HTLC tx fee
4946
4946
let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 1 ] , nodes[ 5 ] , ds_dust_limit* 1000 ) ;
4947
4947
// 2nd HTLC:
4948
- send_along_route_with_secret ( & nodes[ 1 ] , route. clone ( ) , & [ & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 5 ] ] ] , ds_dust_limit* 1000 , payment_hash_1, nodes[ 5 ] . node . create_inbound_payment_for_hash ( payment_hash_1, None , 7200 ) . unwrap ( ) ) ; // not added < dust limit + HTLC tx fee
4948
+ send_along_route_with_secret ( & nodes[ 1 ] , route. clone ( ) , & [ & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 5 ] ] ] , ds_dust_limit* 1000 , payment_hash_1, nodes[ 5 ] . node . create_inbound_payment_for_hash ( payment_hash_1, None , 7200 , None ) . unwrap ( ) ) ; // not added < dust limit + HTLC tx fee
4949
4949
// 3rd HTLC:
4950
- send_along_route_with_secret ( & nodes[ 1 ] , route, & [ & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 5 ] ] ] , ds_dust_limit* 1000 , payment_hash_2, nodes[ 5 ] . node . create_inbound_payment_for_hash ( payment_hash_2, None , 7200 ) . unwrap ( ) ) ; // not added < dust limit + HTLC tx fee
4950
+ send_along_route_with_secret ( & nodes[ 1 ] , route, & [ & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 5 ] ] ] , ds_dust_limit* 1000 , payment_hash_2, nodes[ 5 ] . node . create_inbound_payment_for_hash ( payment_hash_2, None , 7200 , None ) . unwrap ( ) ) ; // not added < dust limit + HTLC tx fee
4951
4951
// 4th HTLC:
4952
4952
let ( _, payment_hash_3, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 4 ] ] , 1000000 ) ;
4953
4953
// 5th HTLC:
4954
4954
let ( _, payment_hash_4, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 4 ] ] , 1000000 ) ;
4955
4955
let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 1 ] , nodes[ 5 ] , 1000000 ) ;
4956
4956
// 6th HTLC:
4957
- send_along_route_with_secret ( & nodes[ 1 ] , route. clone ( ) , & [ & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 5 ] ] ] , 1000000 , payment_hash_3, nodes[ 5 ] . node . create_inbound_payment_for_hash ( payment_hash_3, None , 7200 ) . unwrap ( ) ) ;
4957
+ send_along_route_with_secret ( & nodes[ 1 ] , route. clone ( ) , & [ & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 5 ] ] ] , 1000000 , payment_hash_3, nodes[ 5 ] . node . create_inbound_payment_for_hash ( payment_hash_3, None , 7200 , None ) . unwrap ( ) ) ;
4958
4958
// 7th HTLC:
4959
- send_along_route_with_secret ( & nodes[ 1 ] , route, & [ & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 5 ] ] ] , 1000000 , payment_hash_4, nodes[ 5 ] . node . create_inbound_payment_for_hash ( payment_hash_4, None , 7200 ) . unwrap ( ) ) ;
4959
+ send_along_route_with_secret ( & nodes[ 1 ] , route, & [ & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 5 ] ] ] , 1000000 , payment_hash_4, nodes[ 5 ] . node . create_inbound_payment_for_hash ( payment_hash_4, None , 7200 , None ) . unwrap ( ) ) ;
4960
4960
4961
4961
// 8th HTLC:
4962
4962
let ( _, payment_hash_5, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 4 ] ] , 1000000 ) ;
4963
4963
// 9th HTLC:
4964
4964
let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 1 ] , nodes[ 5 ] , ds_dust_limit* 1000 ) ;
4965
- send_along_route_with_secret ( & nodes[ 1 ] , route, & [ & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 5 ] ] ] , ds_dust_limit* 1000 , payment_hash_5, nodes[ 5 ] . node . create_inbound_payment_for_hash ( payment_hash_5, None , 7200 ) . unwrap ( ) ) ; // not added < dust limit + HTLC tx fee
4965
+ send_along_route_with_secret ( & nodes[ 1 ] , route, & [ & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 5 ] ] ] , ds_dust_limit* 1000 , payment_hash_5, nodes[ 5 ] . node . create_inbound_payment_for_hash ( payment_hash_5, None , 7200 , None ) . unwrap ( ) ) ; // not added < dust limit + HTLC tx fee
4966
4966
4967
4967
// 10th HTLC:
4968
4968
let ( _, payment_hash_6, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 4 ] ] , ds_dust_limit* 1000 ) ; // not added < dust limit + HTLC tx fee
4969
4969
// 11th HTLC:
4970
4970
let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 1 ] , nodes[ 5 ] , 1000000 ) ;
4971
- send_along_route_with_secret ( & nodes[ 1 ] , route, & [ & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 5 ] ] ] , 1000000 , payment_hash_6, nodes[ 5 ] . node . create_inbound_payment_for_hash ( payment_hash_6, None , 7200 ) . unwrap ( ) ) ;
4971
+ send_along_route_with_secret ( & nodes[ 1 ] , route, & [ & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 5 ] ] ] , 1000000 , payment_hash_6, nodes[ 5 ] . node . create_inbound_payment_for_hash ( payment_hash_6, None , 7200 , None ) . unwrap ( ) ) ;
4972
4972
4973
4973
// Double-check that six of the new HTLC were added
4974
4974
// We now have six HTLCs pending over the dust limit and six HTLCs under the dust limit (ie,
@@ -6936,7 +6936,7 @@ fn test_check_htlc_underpaying() {
6936
6936
let payment_params = PaymentParameters :: from_node_id ( nodes[ 1 ] . node . get_our_node_id ( ) ) . with_features ( channelmanager:: provided_invoice_features ( ) ) ;
6937
6937
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 ( ) ;
6938
6938
let ( _, our_payment_hash, _) = get_payment_preimage_hash ! ( nodes[ 0 ] ) ;
6939
- let our_payment_secret = nodes[ 1 ] . node . create_inbound_payment_for_hash ( our_payment_hash, Some ( 100_000 ) , 7200 ) . unwrap ( ) ;
6939
+ let our_payment_secret = nodes[ 1 ] . node . create_inbound_payment_for_hash ( our_payment_hash, Some ( 100_000 ) , 7200 , None ) . unwrap ( ) ;
6940
6940
nodes[ 0 ] . node . send_payment ( & route, our_payment_hash, & Some ( our_payment_secret) , PaymentId ( our_payment_hash. 0 ) ) . unwrap ( ) ;
6941
6941
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
6942
6942
@@ -7939,7 +7939,7 @@ fn test_preimage_storage() {
7939
7939
create_announced_chan_between_nodes ( & nodes, 0 , 1 , channelmanager:: provided_init_features ( ) , channelmanager:: provided_init_features ( ) ) . 0 . contents . short_channel_id ;
7940
7940
7941
7941
{
7942
- let ( payment_hash, payment_secret) = nodes[ 1 ] . node . create_inbound_payment ( Some ( 100_000 ) , 7200 ) . unwrap ( ) ;
7942
+ let ( payment_hash, payment_secret) = nodes[ 1 ] . node . create_inbound_payment ( Some ( 100_000 ) , 7200 , None ) . unwrap ( ) ;
7943
7943
let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 100_000 ) ;
7944
7944
nodes[ 0 ] . node . send_payment ( & route, payment_hash, & Some ( payment_secret) , PaymentId ( payment_hash. 0 ) ) . unwrap ( ) ;
7945
7945
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
@@ -8045,7 +8045,7 @@ fn test_bad_secret_hash() {
8045
8045
8046
8046
let random_payment_hash = PaymentHash ( [ 42 ; 32 ] ) ;
8047
8047
let random_payment_secret = PaymentSecret ( [ 43 ; 32 ] ) ;
8048
- let ( our_payment_hash, our_payment_secret) = nodes[ 1 ] . node . create_inbound_payment ( Some ( 100_000 ) , 2 ) . unwrap ( ) ;
8048
+ let ( our_payment_hash, our_payment_secret) = nodes[ 1 ] . node . create_inbound_payment ( Some ( 100_000 ) , 2 , None ) . unwrap ( ) ;
8049
8049
let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 100_000 ) ;
8050
8050
8051
8051
// All the below cases should end up being handled exactly identically, so we macro the
0 commit comments