@@ -3623,7 +3623,7 @@ fn test_drop_messages_peer_disconnect_dual_htlc() {
3623
3623
claim_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , payment_preimage_2, 1_000_000 ) ;
3624
3624
}
3625
3625
3626
- fn do_test_htlc_timeout ( subpath : bool ) {
3626
+ fn do_test_htlc_timeout ( send_partial_mpp : bool ) {
3627
3627
// If the user fails to claim/fail an HTLC within the HTLC CLTV timeout we fail it for them
3628
3628
// to avoid our counterparty failing the channel.
3629
3629
let chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
@@ -3633,14 +3633,18 @@ fn do_test_htlc_timeout(subpath: bool) {
3633
3633
3634
3634
create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: supported ( ) , InitFeatures :: supported ( ) ) ;
3635
3635
3636
- let our_payment_hash = if subpath {
3636
+ let our_payment_hash = if send_partial_mpp {
3637
3637
let route = nodes[ 0 ] . router . get_route ( & nodes[ 1 ] . node . get_our_node_id ( ) , None , & Vec :: new ( ) , 100000 , TEST_FINAL_CLTV ) . unwrap ( ) ;
3638
3638
let ( _, our_payment_hash) = get_payment_preimage_hash ! ( & nodes[ 0 ] ) ;
3639
3639
let payment_secret = PaymentSecret ( [ 0xdb ; 32 ] ) ;
3640
+ // Use the utility function send_payment_along_path to send the payment with MPP data which
3641
+ // indicates there are more HTLCs coming.
3640
3642
nodes[ 0 ] . node . send_payment_along_path ( & route. paths [ 0 ] , & our_payment_hash, & Some ( payment_secret) , 200000 , CHAN_CONFIRM_DEPTH ) . unwrap ( ) ;
3641
3643
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
3642
3644
let mut events = nodes[ 0 ] . node . get_and_clear_pending_msg_events ( ) ;
3643
3645
assert_eq ! ( events. len( ) , 1 ) ;
3646
+ // Now do the relevant commitment_signed/RAA dances along the path, noting that the final
3647
+ // hop should *not* yet generate any PaymentReceived event(s).
3644
3648
pass_along_path ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 100000 , our_payment_hash, Some ( payment_secret) , events. drain ( ..) . next ( ) . unwrap ( ) , false ) ;
3645
3649
our_payment_hash
3646
3650
} else {
0 commit comments