@@ -1207,7 +1207,7 @@ fn test_duplicate_htlc_different_direction_onchain() {
1207
1207
let ( payment_preimage, payment_hash, _) = route_payment ( & nodes[ 0 ] , & vec ! ( & nodes[ 1 ] ) [ ..] , 900_000 ) ;
1208
1208
1209
1209
let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 1 ] , nodes[ 0 ] , 800_000 ) ;
1210
- let node_a_payment_secret = nodes[ 0 ] . node . create_inbound_payment_for_hash ( payment_hash, None , 7200 ) . unwrap ( ) ;
1210
+ let node_a_payment_secret = nodes[ 0 ] . node . create_inbound_payment_for_hash ( payment_hash, None , 7200 ) ;
1211
1211
send_along_route_with_secret ( & nodes[ 1 ] , route, & [ & [ & nodes[ 0 ] ] ] , 800_000 , payment_hash, node_a_payment_secret) ;
1212
1212
1213
1213
// Provide preimage to node 0 by claiming payment
@@ -5012,7 +5012,7 @@ fn test_duplicate_payment_hash_one_failure_one_success() {
5012
5012
5013
5013
let ( our_payment_preimage, duplicate_payment_hash, _) = route_payment ( & nodes[ 0 ] , & vec ! ( & nodes[ 1 ] , & nodes[ 2 ] ) [ ..] , 900000 ) ;
5014
5014
5015
- let payment_secret = nodes[ 3 ] . node . create_inbound_payment_for_hash ( duplicate_payment_hash, None , 7200 ) . unwrap ( ) ;
5015
+ let payment_secret = nodes[ 3 ] . node . create_inbound_payment_for_hash ( duplicate_payment_hash, None , 7200 ) ;
5016
5016
// We reduce the final CLTV here by a somewhat arbitrary constant to keep it under the one-byte
5017
5017
// script push size limit so that the below script length checks match
5018
5018
// ACCEPTED_HTLC_SCRIPT_WEIGHT.
@@ -5215,30 +5215,30 @@ fn do_test_fail_backwards_unrevoked_remote_announce(deliver_last_raa: bool, anno
5215
5215
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
5216
5216
let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 1 ] , nodes[ 5 ] , ds_dust_limit* 1000 ) ;
5217
5217
// 2nd HTLC:
5218
- 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
5218
+ 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 ) ) ; // not added < dust limit + HTLC tx fee
5219
5219
// 3rd HTLC:
5220
- 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
5220
+ 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 ) ) ; // not added < dust limit + HTLC tx fee
5221
5221
// 4th HTLC:
5222
5222
let ( _, payment_hash_3, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 4 ] ] , 1000000 ) ;
5223
5223
// 5th HTLC:
5224
5224
let ( _, payment_hash_4, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 4 ] ] , 1000000 ) ;
5225
5225
let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 1 ] , nodes[ 5 ] , 1000000 ) ;
5226
5226
// 6th HTLC:
5227
- 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 ( ) ) ;
5227
+ 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 ) ) ;
5228
5228
// 7th HTLC:
5229
- 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 ( ) ) ;
5229
+ 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 ) ) ;
5230
5230
5231
5231
// 8th HTLC:
5232
5232
let ( _, payment_hash_5, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 2 ] , & nodes[ 3 ] , & nodes[ 4 ] ] , 1000000 ) ;
5233
5233
// 9th HTLC:
5234
5234
let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 1 ] , nodes[ 5 ] , ds_dust_limit* 1000 ) ;
5235
- 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
5235
+ 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 ) ) ; // not added < dust limit + HTLC tx fee
5236
5236
5237
5237
// 10th HTLC:
5238
5238
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
5239
5239
// 11th HTLC:
5240
5240
let ( route, _, _, _) = get_route_and_payment_hash ! ( nodes[ 1 ] , nodes[ 5 ] , 1000000 ) ;
5241
- 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 ( ) ) ;
5241
+ 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 ) ) ;
5242
5242
5243
5243
// Double-check that six of the new HTLC were added
5244
5244
// We now have six HTLCs pending over the dust limit and six HTLCs under the dust limit (ie,
@@ -7219,7 +7219,7 @@ fn test_check_htlc_underpaying() {
7219
7219
let payee = Payee :: from_node_id ( nodes[ 1 ] . node . get_our_node_id ( ) ) . with_features ( InvoiceFeatures :: known ( ) ) ;
7220
7220
let route = get_route ( & nodes[ 0 ] . node . get_our_node_id ( ) , & payee, nodes[ 0 ] . network_graph , None , 10_000 , TEST_FINAL_CLTV , nodes[ 0 ] . logger , & scorer) . unwrap ( ) ;
7221
7221
let ( _, our_payment_hash, _) = get_payment_preimage_hash ! ( nodes[ 0 ] ) ;
7222
- let our_payment_secret = nodes[ 1 ] . node . create_inbound_payment_for_hash ( our_payment_hash, Some ( 100_000 ) , 7200 ) . unwrap ( ) ;
7222
+ let our_payment_secret = nodes[ 1 ] . node . create_inbound_payment_for_hash ( our_payment_hash, Some ( 100_000 ) , 7200 ) ;
7223
7223
nodes[ 0 ] . node . send_payment ( & route, our_payment_hash, & Some ( our_payment_secret) ) . unwrap ( ) ;
7224
7224
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
7225
7225
0 commit comments