@@ -83,7 +83,11 @@ fn mpp_retry() {
83
83
send_payment ( & nodes[ 3 ] , & vec ! ( & nodes[ 2 ] ) [ ..] , 1_500_000 ) ;
84
84
85
85
let amt_msat = 1_000_000 ;
86
- let ( mut route, payment_hash, payment_preimage, payment_secret) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 3 ] , amt_msat) ;
86
+ let max_total_routing_fee_msat = 50_000 ;
87
+ let payment_params = PaymentParameters :: from_node_id ( nodes[ 3 ] . node . get_our_node_id ( ) , TEST_FINAL_CLTV )
88
+ . with_bolt11_features ( nodes[ 3 ] . node . invoice_features ( ) ) . unwrap ( ) ;
89
+ let ( mut route, payment_hash, payment_preimage, payment_secret) = get_route_and_payment_hash ! (
90
+ nodes[ 0 ] , nodes[ 3 ] , payment_params, amt_msat, Some ( max_total_routing_fee_msat) ) ;
87
91
let path = route. paths [ 0 ] . clone ( ) ;
88
92
route. paths . push ( path) ;
89
93
route. paths [ 0 ] . hops [ 0 ] . pubkey = nodes[ 1 ] . node . get_our_node_id ( ) ;
@@ -150,6 +154,9 @@ fn mpp_retry() {
150
154
route. paths . remove ( 0 ) ;
151
155
route_params. final_value_msat = 1_000_000 ;
152
156
route_params. payment_params . previously_failed_channels . push ( chan_4_update. contents . short_channel_id ) ;
157
+ // Check the remaining max total routing fee for the second attempt is 50_000 - 1_000 msat fee
158
+ // used by the first path
159
+ route_params. max_total_routing_fee_msat = Some ( max_total_routing_fee_msat - 1_000 ) ;
153
160
nodes[ 0 ] . router . expect_find_route ( route_params, Ok ( route) ) ;
154
161
nodes[ 0 ] . node . process_pending_htlc_forwards ( ) ;
155
162
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
0 commit comments