@@ -3978,11 +3978,19 @@ fn test_single_channel_multiple_mpp() {
3978
3978
let ( updates, raa) = get_updates_and_revoke ( & nodes[ 6 ] , & nodes[ 5 ] . node . get_our_node_id ( ) ) ;
3979
3979
nodes[ 5 ] . node . handle_update_fulfill_htlc ( node_6_id, & updates. update_fulfill_htlcs [ 0 ] ) ;
3980
3980
expect_payment_forwarded ! ( nodes[ 5 ] , nodes[ 2 ] , nodes[ 6 ] , Some ( 1000 ) , false , false ) ;
3981
- nodes[ 5 ] . node . handle_update_fulfill_htlc ( node_6_id, & updates. update_fulfill_htlcs [ 1 ] ) ;
3982
- expect_payment_forwarded ! ( nodes[ 5 ] , nodes[ 3 ] , nodes[ 6 ] , Some ( 1000 ) , false , false ) ;
3981
+ let mut next_from = 3 ;
3982
+ if let Some ( update) = updates. update_fulfill_htlcs . get ( 1 ) {
3983
+ nodes[ 5 ] . node . handle_update_fulfill_htlc ( node_6_id, update) ;
3984
+ expect_payment_forwarded ! ( nodes[ 5 ] , nodes[ next_from] , nodes[ 6 ] , Some ( 1000 ) , false , false ) ;
3985
+ next_from_node -= 1 ;
3986
+ }
3983
3987
nodes[ 5 ] . node . handle_commitment_signed ( node_6_id, & updates. commitment_signed ) ;
3984
3988
nodes[ 5 ] . node . handle_revoke_and_ack ( node_6_id, & raa) ;
3985
- check_added_monitors ( & nodes[ 5 ] , 4 ) ;
3989
+ if updates. update_fulfill_htlcs . get ( 1 ) . is_some ( ) {
3990
+ check_added_monitors ( & nodes[ 5 ] , 4 ) ;
3991
+ } else {
3992
+ check_added_monitors ( & nodes[ 5 ] , 3 ) ;
3993
+ }
3986
3994
3987
3995
let ( raa, cs) = get_revoke_commit_msgs ( & nodes[ 5 ] , & node_6_id) ;
3988
3996
@@ -3992,10 +4000,19 @@ fn test_single_channel_multiple_mpp() {
3992
4000
3993
4001
let ( updates, raa) = get_updates_and_revoke ( & nodes[ 6 ] , & nodes[ 5 ] . node . get_our_node_id ( ) ) ;
3994
4002
nodes[ 5 ] . node . handle_update_fulfill_htlc ( node_6_id, & updates. update_fulfill_htlcs [ 0 ] ) ;
3995
- expect_payment_forwarded ! ( nodes[ 5 ] , nodes[ 4 ] , nodes[ 6 ] , Some ( 1000 ) , false , false ) ;
4003
+ expect_payment_forwarded ! ( nodes[ 5 ] , nodes[ next_from] , nodes[ 6 ] , Some ( 1000 ) , false , false ) ;
4004
+ next_from_node -= 1 ;
4005
+ if let Some ( update) = updates. update_fulfill_htlcs . get ( 1 ) {
4006
+ nodes[ 5 ] . node . handle_update_fulfill_htlc ( node_6_id, update) ;
4007
+ expect_payment_forwarded ! ( nodes[ 5 ] , nodes[ next_from] , nodes[ 6 ] , Some ( 1000 ) , false , false ) ;
4008
+ }
3996
4009
nodes[ 5 ] . node . handle_commitment_signed ( node_6_id, & updates. commitment_signed ) ;
3997
4010
nodes[ 5 ] . node . handle_revoke_and_ack ( node_6_id, & raa) ;
3998
- check_added_monitors ( & nodes[ 5 ] , 3 ) ;
4011
+ if updates. update_fulfill_htlcs . get ( 1 ) . is_some ( ) {
4012
+ check_added_monitors ( & nodes[ 5 ] , 4 ) ;
4013
+ } else {
4014
+ check_added_monitors ( & nodes[ 5 ] , 3 ) ;
4015
+ }
3999
4016
4000
4017
let ( raa, cs) = get_revoke_commit_msgs ( & nodes[ 5 ] , & node_6_id) ;
4001
4018
nodes[ 6 ] . node . handle_revoke_and_ack ( node_5_id, & raa) ;
0 commit comments