@@ -1240,7 +1240,7 @@ fn test_duplicate_htlc_different_direction_onchain() {
12401240 let ( payment_preimage, payment_hash, _) = route_payment ( & nodes[ 0 ] , & vec ! ( & nodes[ 1 ] ) [ ..] , 900_000 ) ;
12411241
12421242 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 ( ) ;
12441244 send_along_route_with_secret ( & nodes[ 1 ] , route, & [ & [ & nodes[ 0 ] ] ] , 800_000 , payment_hash, node_a_payment_secret) ;
12451245
12461246 // Provide preimage to node 0 by claiming payment
@@ -4723,7 +4723,7 @@ fn test_duplicate_payment_hash_one_failure_one_success() {
47234723
47244724 let ( our_payment_preimage, duplicate_payment_hash, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , 900_000 ) ;
47254725
4726- let payment_secret = nodes[ 3 ] . node . create_inbound_payment_for_hash ( duplicate_payment_hash, None , 7200 ) . unwrap ( ) ;
4726+ let payment_secret = nodes[ 3 ] . node . create_inbound_payment_for_hash ( duplicate_payment_hash, None , 7200 , None ) . unwrap ( ) ;
47274727 // We reduce the final CLTV here by a somewhat arbitrary constant to keep it under the one-byte
47284728 // script push size limit so that the below script length checks match
47294729 // ACCEPTED_HTLC_SCRIPT_WEIGHT.
@@ -4941,30 +4941,30 @@ fn do_test_fail_backwards_unrevoked_remote_announce(deliver_last_raa: bool, anno
49414941 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
49424942 let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 1 ] , nodes[ 5 ] , ds_dust_limit* 1000 ) ;
49434943 // 2nd HTLC:
4944- 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
4944+ 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
49454945 // 3rd HTLC:
4946- 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
4946+ 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
49474947 // 4th HTLC:
49484948 let ( _, payment_hash_3, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 4 ] ] , 1000000 ) ;
49494949 // 5th HTLC:
49504950 let ( _, payment_hash_4, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 4 ] ] , 1000000 ) ;
49514951 let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 1 ] , nodes[ 5 ] , 1000000 ) ;
49524952 // 6th HTLC:
4953- 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 ( ) ) ;
4953+ 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 ( ) ) ;
49544954 // 7th HTLC:
4955- 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 ( ) ) ;
4955+ 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 ( ) ) ;
49564956
49574957 // 8th HTLC:
49584958 let ( _, payment_hash_5, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 4 ] ] , 1000000 ) ;
49594959 // 9th HTLC:
49604960 let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 1 ] , nodes[ 5 ] , ds_dust_limit* 1000 ) ;
4961- 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
4961+ 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
49624962
49634963 // 10th HTLC:
49644964 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
49654965 // 11th HTLC:
49664966 let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 1 ] , nodes[ 5 ] , 1000000 ) ;
4967- 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 ( ) ) ;
4967+ 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 ( ) ) ;
49684968
49694969 // Double-check that six of the new HTLC were added
49704970 // We now have six HTLCs pending over the dust limit and six HTLCs under the dust limit (ie,
@@ -6932,7 +6932,7 @@ fn test_check_htlc_underpaying() {
69326932 let payment_params = PaymentParameters :: from_node_id ( nodes[ 1 ] . node . get_our_node_id ( ) ) . with_features ( channelmanager:: provided_invoice_features ( ) ) ;
69336933 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 ( ) ;
69346934 let ( _, our_payment_hash, _) = get_payment_preimage_hash ! ( nodes[ 0 ] ) ;
6935- let our_payment_secret = nodes[ 1 ] . node . create_inbound_payment_for_hash ( our_payment_hash, Some ( 100_000 ) , 7200 ) . unwrap ( ) ;
6935+ let our_payment_secret = nodes[ 1 ] . node . create_inbound_payment_for_hash ( our_payment_hash, Some ( 100_000 ) , 7200 , None ) . unwrap ( ) ;
69366936 nodes[ 0 ] . node . send_payment ( & route, our_payment_hash, & Some ( our_payment_secret) , PaymentId ( our_payment_hash. 0 ) ) . unwrap ( ) ;
69376937 check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
69386938
@@ -7935,7 +7935,7 @@ fn test_preimage_storage() {
79357935 create_announced_chan_between_nodes ( & nodes, 0 , 1 , channelmanager:: provided_init_features ( ) , channelmanager:: provided_init_features ( ) ) . 0 . contents . short_channel_id ;
79367936
79377937 {
7938- let ( payment_hash, payment_secret) = nodes[ 1 ] . node . create_inbound_payment ( Some ( 100_000 ) , 7200 ) . unwrap ( ) ;
7938+ let ( payment_hash, payment_secret) = nodes[ 1 ] . node . create_inbound_payment ( Some ( 100_000 ) , 7200 , None ) . unwrap ( ) ;
79397939 let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 100_000 ) ;
79407940 nodes[ 0 ] . node . send_payment ( & route, payment_hash, & Some ( payment_secret) , PaymentId ( payment_hash. 0 ) ) . unwrap ( ) ;
79417941 check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
@@ -8041,7 +8041,7 @@ fn test_bad_secret_hash() {
80418041
80428042 let random_payment_hash = PaymentHash ( [ 42 ; 32 ] ) ;
80438043 let random_payment_secret = PaymentSecret ( [ 43 ; 32 ] ) ;
8044- let ( our_payment_hash, our_payment_secret) = nodes[ 1 ] . node . create_inbound_payment ( Some ( 100_000 ) , 2 ) . unwrap ( ) ;
8044+ let ( our_payment_hash, our_payment_secret) = nodes[ 1 ] . node . create_inbound_payment ( Some ( 100_000 ) , 2 , None ) . unwrap ( ) ;
80458045 let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 100_000 ) ;
80468046
80478047 // All the below cases should end up being handled exactly identically, so we macro the
0 commit comments