@@ -3978,11 +3978,19 @@ fn test_single_channel_multiple_mpp() {
39783978 let ( updates, raa) = get_updates_and_revoke ( & nodes[ 6 ] , & nodes[ 5 ] . node . get_our_node_id ( ) ) ;
39793979 nodes[ 5 ] . node . handle_update_fulfill_htlc ( node_6_id, & updates. update_fulfill_htlcs [ 0 ] ) ;
39803980 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 += 1 ;
3986+ }
39833987 nodes[ 5 ] . node . handle_commitment_signed ( node_6_id, & updates. commitment_signed ) ;
39843988 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+ }
39863994
39873995 let ( raa, cs) = get_revoke_commit_msgs ( & nodes[ 5 ] , & node_6_id) ;
39883996
@@ -3992,10 +4000,19 @@ fn test_single_channel_multiple_mpp() {
39924000
39934001 let ( updates, raa) = get_updates_and_revoke ( & nodes[ 6 ] , & nodes[ 5 ] . node . get_our_node_id ( ) ) ;
39944002 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 += 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+ }
39964009 nodes[ 5 ] . node . handle_commitment_signed ( node_6_id, & updates. commitment_signed ) ;
39974010 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+ }
39994016
40004017 let ( raa, cs) = get_revoke_commit_msgs ( & nodes[ 5 ] , & node_6_id) ;
40014018 nodes[ 6 ] . node . handle_revoke_and_ack ( node_5_id, & raa) ;
0 commit comments