@@ -289,8 +289,6 @@ fn do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack(
289289 let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
290290 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
291291 let nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
292- let node_a_id = nodes[ 0 ] . node . get_our_node_id ( ) ;
293- let node_b_id = nodes[ 1 ] . node . get_our_node_id ( ) ;
294292 let ( _, _, chan_id, _) = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
295293
296294 // Send a payment.
@@ -533,8 +531,6 @@ fn do_test_async_raa_peer_disconnect(
533531 let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
534532 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
535533 let nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
536- let node_a_id = nodes[ 0 ] . node . get_our_node_id ( ) ;
537- let node_b_id = nodes[ 1 ] . node . get_our_node_id ( ) ;
538534 let ( _, _, chan_id, _) = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
539535
540536 // Send a payment.
@@ -699,8 +695,6 @@ fn do_test_async_commitment_signature_peer_disconnect(
699695 let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
700696 let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
701697 let nodes = create_network ( 2 , & node_cfgs, & node_chanmgrs) ;
702- let node_a_id = nodes[ 0 ] . node . get_our_node_id ( ) ;
703- let node_b_id = nodes[ 1 ] . node . get_our_node_id ( ) ;
704698 let ( _, _, chan_id, _) = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
705699
706700 // Send a payment.
@@ -1422,13 +1416,10 @@ fn test_no_disconnect_while_async_revoke_and_ack_expecting_remote_commitment_sig
14221416 let node_b_id = nodes[ 1 ] . node . get_our_node_id ( ) ;
14231417 let chan_id = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) . 2 ;
14241418
1425- let node_id_0 = node_a_id;
1426- let node_id_1 = node_b_id;
1427-
14281419 let payment_amount = 1_000_000 ;
14291420 send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , payment_amount * 4 ) ;
14301421
1431- nodes[ 1 ] . disable_channel_signer_op ( & node_id_0 , & chan_id, SignerOp :: ReleaseCommitmentSecret ) ;
1422+ nodes[ 1 ] . disable_channel_signer_op ( & node_a_id , & chan_id, SignerOp :: ReleaseCommitmentSecret ) ;
14321423
14331424 // We'll send a payment from both nodes to each other.
14341425 let ( route1, payment_hash1, _, payment_secret1) =
@@ -1445,20 +1436,20 @@ fn test_no_disconnect_while_async_revoke_and_ack_expecting_remote_commitment_sig
14451436 nodes[ 1 ] . node . send_payment_with_route ( route2, payment_hash2, onion2, payment_id2) . unwrap ( ) ;
14461437 check_added_monitors ( & nodes[ 1 ] , 1 ) ;
14471438
1448- let update = get_htlc_update_msgs ! ( & nodes[ 0 ] , node_id_1 ) ;
1449- nodes[ 1 ] . node . handle_update_add_htlc ( node_id_0 , & update. update_add_htlcs [ 0 ] ) ;
1450- nodes[ 1 ] . node . handle_commitment_signed_batch_test ( node_id_0 , & update. commitment_signed ) ;
1439+ let update = get_htlc_update_msgs ! ( & nodes[ 0 ] , node_b_id ) ;
1440+ nodes[ 1 ] . node . handle_update_add_htlc ( node_a_id , & update. update_add_htlcs [ 0 ] ) ;
1441+ nodes[ 1 ] . node . handle_commitment_signed_batch_test ( node_a_id , & update. commitment_signed ) ;
14511442 check_added_monitors ( & nodes[ 1 ] , 1 ) ;
14521443
1453- let update = get_htlc_update_msgs ! ( & nodes[ 1 ] , node_id_0 ) ;
1454- nodes[ 0 ] . node . handle_update_add_htlc ( node_id_1 , & update. update_add_htlcs [ 0 ] ) ;
1455- nodes[ 0 ] . node . handle_commitment_signed_batch_test ( node_id_1 , & update. commitment_signed ) ;
1444+ let update = get_htlc_update_msgs ! ( & nodes[ 1 ] , node_a_id ) ;
1445+ nodes[ 0 ] . node . handle_update_add_htlc ( node_b_id , & update. update_add_htlcs [ 0 ] ) ;
1446+ nodes[ 0 ] . node . handle_commitment_signed_batch_test ( node_b_id , & update. commitment_signed ) ;
14561447 check_added_monitors ( & nodes[ 0 ] , 1 ) ;
14571448
14581449 // nodes[0] can only respond with a `revoke_and_ack`. The `commitment_signed` that would follow
14591450 // is blocked on receiving a counterparty `revoke_and_ack`, which nodes[1] is still pending on.
1460- let revoke_and_ack = get_event_msg ! ( & nodes[ 0 ] , MessageSendEvent :: SendRevokeAndACK , node_id_1 ) ;
1461- nodes[ 1 ] . node . handle_revoke_and_ack ( node_id_0 , & revoke_and_ack) ;
1451+ let revoke_and_ack = get_event_msg ! ( & nodes[ 0 ] , MessageSendEvent :: SendRevokeAndACK , node_b_id ) ;
1452+ nodes[ 1 ] . node . handle_revoke_and_ack ( node_a_id , & revoke_and_ack) ;
14621453 check_added_monitors ( & nodes[ 1 ] , 1 ) ;
14631454
14641455 assert ! ( nodes[ 0 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
@@ -1495,27 +1486,24 @@ fn test_no_disconnect_while_async_commitment_signed_expecting_remote_revoke_and_
14951486 let node_b_id = nodes[ 1 ] . node . get_our_node_id ( ) ;
14961487 let chan_id = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) . 2 ;
14971488
1498- let node_id_0 = node_a_id;
1499- let node_id_1 = node_b_id;
1500-
15011489 // Route a payment and attempt to claim it.
15021490 let payment_amount = 1_000_000 ;
15031491 let ( preimage, payment_hash, ..) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , payment_amount) ;
15041492 nodes[ 1 ] . node . claim_funds ( preimage) ;
15051493 check_added_monitors ( & nodes[ 1 ] , 1 ) ;
15061494
15071495 // We'll disable signing counterparty commitments on the payment sender.
1508- nodes[ 0 ] . disable_channel_signer_op ( & node_id_1 , & chan_id, SignerOp :: SignCounterpartyCommitment ) ;
1496+ nodes[ 0 ] . disable_channel_signer_op ( & node_b_id , & chan_id, SignerOp :: SignCounterpartyCommitment ) ;
15091497
15101498 // After processing the `update_fulfill`, they'll only be able to send `revoke_and_ack` until
15111499 // the `commitment_signed` is no longer pending.
1512- let update = get_htlc_update_msgs ! ( & nodes[ 1 ] , node_id_0 ) ;
1513- nodes[ 0 ] . node . handle_update_fulfill_htlc ( node_id_1 , & update. update_fulfill_htlcs [ 0 ] ) ;
1514- nodes[ 0 ] . node . handle_commitment_signed_batch_test ( node_id_1 , & update. commitment_signed ) ;
1500+ let update = get_htlc_update_msgs ! ( & nodes[ 1 ] , node_a_id ) ;
1501+ nodes[ 0 ] . node . handle_update_fulfill_htlc ( node_b_id , & update. update_fulfill_htlcs [ 0 ] ) ;
1502+ nodes[ 0 ] . node . handle_commitment_signed_batch_test ( node_b_id , & update. commitment_signed ) ;
15151503 check_added_monitors ( & nodes[ 0 ] , 1 ) ;
15161504
1517- let revoke_and_ack = get_event_msg ! ( & nodes[ 0 ] , MessageSendEvent :: SendRevokeAndACK , node_id_1 ) ;
1518- nodes[ 1 ] . node . handle_revoke_and_ack ( node_id_0 , & revoke_and_ack) ;
1505+ let revoke_and_ack = get_event_msg ! ( & nodes[ 0 ] , MessageSendEvent :: SendRevokeAndACK , node_b_id ) ;
1506+ nodes[ 1 ] . node . handle_revoke_and_ack ( node_a_id , & revoke_and_ack) ;
15191507 check_added_monitors ( & nodes[ 1 ] , 1 ) ;
15201508
15211509 // The payment sender shouldn't disconnect the counterparty due to a missing `revoke_and_ack`
0 commit comments