@@ -289,8 +289,6 @@ fn do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack(
289
289
let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
290
290
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
291
291
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 ( ) ;
294
292
let ( _, _, chan_id, _) = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
295
293
296
294
// Send a payment.
@@ -533,8 +531,6 @@ fn do_test_async_raa_peer_disconnect(
533
531
let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
534
532
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
535
533
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 ( ) ;
538
534
let ( _, _, chan_id, _) = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
539
535
540
536
// Send a payment.
@@ -699,8 +695,6 @@ fn do_test_async_commitment_signature_peer_disconnect(
699
695
let node_cfgs = create_node_cfgs ( 2 , & chanmon_cfgs) ;
700
696
let node_chanmgrs = create_node_chanmgrs ( 2 , & node_cfgs, & [ None , None ] ) ;
701
697
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 ( ) ;
704
698
let ( _, _, chan_id, _) = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) ;
705
699
706
700
// Send a payment.
@@ -1422,13 +1416,10 @@ fn test_no_disconnect_while_async_revoke_and_ack_expecting_remote_commitment_sig
1422
1416
let node_b_id = nodes[ 1 ] . node . get_our_node_id ( ) ;
1423
1417
let chan_id = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) . 2 ;
1424
1418
1425
- let node_id_0 = node_a_id;
1426
- let node_id_1 = node_b_id;
1427
-
1428
1419
let payment_amount = 1_000_000 ;
1429
1420
send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , payment_amount * 4 ) ;
1430
1421
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 ) ;
1432
1423
1433
1424
// We'll send a payment from both nodes to each other.
1434
1425
let ( route1, payment_hash1, _, payment_secret1) =
@@ -1445,20 +1436,20 @@ fn test_no_disconnect_while_async_revoke_and_ack_expecting_remote_commitment_sig
1445
1436
nodes[ 1 ] . node . send_payment_with_route ( route2, payment_hash2, onion2, payment_id2) . unwrap ( ) ;
1446
1437
check_added_monitors ( & nodes[ 1 ] , 1 ) ;
1447
1438
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 ) ;
1451
1442
check_added_monitors ( & nodes[ 1 ] , 1 ) ;
1452
1443
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 ) ;
1456
1447
check_added_monitors ( & nodes[ 0 ] , 1 ) ;
1457
1448
1458
1449
// nodes[0] can only respond with a `revoke_and_ack`. The `commitment_signed` that would follow
1459
1450
// 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) ;
1462
1453
check_added_monitors ( & nodes[ 1 ] , 1 ) ;
1463
1454
1464
1455
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_
1495
1486
let node_b_id = nodes[ 1 ] . node . get_our_node_id ( ) ;
1496
1487
let chan_id = create_announced_chan_between_nodes ( & nodes, 0 , 1 ) . 2 ;
1497
1488
1498
- let node_id_0 = node_a_id;
1499
- let node_id_1 = node_b_id;
1500
-
1501
1489
// Route a payment and attempt to claim it.
1502
1490
let payment_amount = 1_000_000 ;
1503
1491
let ( preimage, payment_hash, ..) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , payment_amount) ;
1504
1492
nodes[ 1 ] . node . claim_funds ( preimage) ;
1505
1493
check_added_monitors ( & nodes[ 1 ] , 1 ) ;
1506
1494
1507
1495
// 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 ) ;
1509
1497
1510
1498
// After processing the `update_fulfill`, they'll only be able to send `revoke_and_ack` until
1511
1499
// 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 ) ;
1515
1503
check_added_monitors ( & nodes[ 0 ] , 1 ) ;
1516
1504
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) ;
1519
1507
check_added_monitors ( & nodes[ 1 ] , 1 ) ;
1520
1508
1521
1509
// The payment sender shouldn't disconnect the counterparty due to a missing `revoke_and_ack`
0 commit comments