@@ -806,13 +806,13 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
806
806
networks: None ,
807
807
remote_network_address: None ,
808
808
} ;
809
- $source. peer_connected( & $dest. get_our_node_id( ) , & init_dest, true ) . unwrap( ) ;
809
+ $source. peer_connected( $dest. get_our_node_id( ) , & init_dest, true ) . unwrap( ) ;
810
810
let init_src = Init {
811
811
features: $source. init_features( ) ,
812
812
networks: None ,
813
813
remote_network_address: None ,
814
814
} ;
815
- $dest. peer_connected( & $source. get_our_node_id( ) , & init_src, false ) . unwrap( ) ;
815
+ $dest. peer_connected( $source. get_our_node_id( ) , & init_src, false ) . unwrap( ) ;
816
816
817
817
$source. create_channel( $dest. get_our_node_id( ) , 100_000 , 42 , 0 , None , None ) . unwrap( ) ;
818
818
let open_channel = {
@@ -825,7 +825,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
825
825
}
826
826
} ;
827
827
828
- $dest. handle_open_channel( & $source. get_our_node_id( ) , & open_channel) ;
828
+ $dest. handle_open_channel( $source. get_our_node_id( ) , & open_channel) ;
829
829
let accept_channel = {
830
830
if anchors {
831
831
let events = $dest. get_and_clear_pending_events( ) ;
@@ -860,7 +860,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
860
860
}
861
861
} ;
862
862
863
- $source. handle_accept_channel( & $dest. get_our_node_id( ) , & accept_channel) ;
863
+ $source. handle_accept_channel( $dest. get_our_node_id( ) , & accept_channel) ;
864
864
let funding_output;
865
865
{
866
866
let mut events = $source. get_and_clear_pending_events( ) ;
@@ -904,7 +904,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
904
904
panic!( "Wrong event type" ) ;
905
905
}
906
906
} ;
907
- $dest. handle_funding_created( & $source. get_our_node_id( ) , & funding_created) ;
907
+ $dest. handle_funding_created( $source. get_our_node_id( ) , & funding_created) ;
908
908
909
909
let funding_signed = {
910
910
let events = $dest. get_and_clear_pending_msg_events( ) ;
@@ -923,7 +923,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
923
923
panic!( "Wrong event type" ) ;
924
924
}
925
925
926
- $source. handle_funding_signed( & $dest. get_our_node_id( ) , & funding_signed) ;
926
+ $source. handle_funding_signed( $dest. get_our_node_id( ) , & funding_signed) ;
927
927
let events = $source. get_and_clear_pending_events( ) ;
928
928
assert_eq!( events. len( ) , 1 ) ;
929
929
if let events:: Event :: ChannelPending { ref counterparty_node_id, .. } = events[ 0 ] {
@@ -963,7 +963,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
963
963
{
964
964
for node in $nodes. iter( ) {
965
965
if node. get_our_node_id( ) == * node_id {
966
- node. handle_channel_ready( & $nodes[ idx] . get_our_node_id( ) , msg) ;
966
+ node. handle_channel_ready( $nodes[ idx] . get_our_node_id( ) , msg) ;
967
967
}
968
968
}
969
969
} else {
@@ -1134,7 +1134,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
1134
1134
for update_add in update_add_htlcs. iter( ) {
1135
1135
out. locked_write( format!( "Delivering update_add_htlc to node {}.\n " , idx) . as_bytes( ) ) ;
1136
1136
if !$corrupt_forward {
1137
- dest. handle_update_add_htlc( & nodes[ $node] . get_our_node_id( ) , update_add) ;
1137
+ dest. handle_update_add_htlc( nodes[ $node] . get_our_node_id( ) , update_add) ;
1138
1138
} else {
1139
1139
// Corrupt the update_add_htlc message so that its HMAC
1140
1140
// check will fail and we generate a
@@ -1143,24 +1143,24 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
1143
1143
let mut msg_ser = update_add. encode( ) ;
1144
1144
msg_ser[ 1000 ] ^= 0xff ;
1145
1145
let new_msg = UpdateAddHTLC :: read( & mut Cursor :: new( & msg_ser) ) . unwrap( ) ;
1146
- dest. handle_update_add_htlc( & nodes[ $node] . get_our_node_id( ) , & new_msg) ;
1146
+ dest. handle_update_add_htlc( nodes[ $node] . get_our_node_id( ) , & new_msg) ;
1147
1147
}
1148
1148
}
1149
1149
for update_fulfill in update_fulfill_htlcs. iter( ) {
1150
1150
out. locked_write( format!( "Delivering update_fulfill_htlc to node {}.\n " , idx) . as_bytes( ) ) ;
1151
- dest. handle_update_fulfill_htlc( & nodes[ $node] . get_our_node_id( ) , update_fulfill) ;
1151
+ dest. handle_update_fulfill_htlc( nodes[ $node] . get_our_node_id( ) , update_fulfill) ;
1152
1152
}
1153
1153
for update_fail in update_fail_htlcs. iter( ) {
1154
1154
out. locked_write( format!( "Delivering update_fail_htlc to node {}.\n " , idx) . as_bytes( ) ) ;
1155
- dest. handle_update_fail_htlc( & nodes[ $node] . get_our_node_id( ) , update_fail) ;
1155
+ dest. handle_update_fail_htlc( nodes[ $node] . get_our_node_id( ) , update_fail) ;
1156
1156
}
1157
1157
for update_fail_malformed in update_fail_malformed_htlcs. iter( ) {
1158
1158
out. locked_write( format!( "Delivering update_fail_malformed_htlc to node {}.\n " , idx) . as_bytes( ) ) ;
1159
- dest. handle_update_fail_malformed_htlc( & nodes[ $node] . get_our_node_id( ) , update_fail_malformed) ;
1159
+ dest. handle_update_fail_malformed_htlc( nodes[ $node] . get_our_node_id( ) , update_fail_malformed) ;
1160
1160
}
1161
1161
if let Some ( msg) = update_fee {
1162
1162
out. locked_write( format!( "Delivering update_fee to node {}.\n " , idx) . as_bytes( ) ) ;
1163
- dest. handle_update_fee( & nodes[ $node] . get_our_node_id( ) , & msg) ;
1163
+ dest. handle_update_fee( nodes[ $node] . get_our_node_id( ) , & msg) ;
1164
1164
}
1165
1165
let processed_change = !update_add_htlcs. is_empty( ) || !update_fulfill_htlcs. is_empty( ) ||
1166
1166
!update_fail_htlcs. is_empty( ) || !update_fail_malformed_htlcs. is_empty( ) ;
@@ -1177,7 +1177,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
1177
1177
break ;
1178
1178
}
1179
1179
out. locked_write( format!( "Delivering commitment_signed to node {}.\n " , idx) . as_bytes( ) ) ;
1180
- dest. handle_commitment_signed( & nodes[ $node] . get_our_node_id( ) , & commitment_signed) ;
1180
+ dest. handle_commitment_signed( nodes[ $node] . get_our_node_id( ) , & commitment_signed) ;
1181
1181
break ;
1182
1182
}
1183
1183
}
@@ -1186,15 +1186,15 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
1186
1186
for ( idx, dest) in nodes. iter( ) . enumerate( ) {
1187
1187
if dest. get_our_node_id( ) == * node_id {
1188
1188
out. locked_write( format!( "Delivering revoke_and_ack to node {}.\n " , idx) . as_bytes( ) ) ;
1189
- dest. handle_revoke_and_ack( & nodes[ $node] . get_our_node_id( ) , msg) ;
1189
+ dest. handle_revoke_and_ack( nodes[ $node] . get_our_node_id( ) , msg) ;
1190
1190
}
1191
1191
}
1192
1192
} ,
1193
1193
events:: MessageSendEvent :: SendChannelReestablish { ref node_id, ref msg } => {
1194
1194
for ( idx, dest) in nodes. iter( ) . enumerate( ) {
1195
1195
if dest. get_our_node_id( ) == * node_id {
1196
1196
out. locked_write( format!( "Delivering channel_reestablish to node {}.\n " , idx) . as_bytes( ) ) ;
1197
- dest. handle_channel_reestablish( & nodes[ $node] . get_our_node_id( ) , msg) ;
1197
+ dest. handle_channel_reestablish( nodes[ $node] . get_our_node_id( ) , msg) ;
1198
1198
}
1199
1199
}
1200
1200
} ,
@@ -1453,16 +1453,16 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
1453
1453
1454
1454
0x0c => {
1455
1455
if !chan_a_disconnected {
1456
- nodes[ 0 ] . peer_disconnected ( & nodes[ 1 ] . get_our_node_id ( ) ) ;
1457
- nodes[ 1 ] . peer_disconnected ( & nodes[ 0 ] . get_our_node_id ( ) ) ;
1456
+ nodes[ 0 ] . peer_disconnected ( nodes[ 1 ] . get_our_node_id ( ) ) ;
1457
+ nodes[ 1 ] . peer_disconnected ( nodes[ 0 ] . get_our_node_id ( ) ) ;
1458
1458
chan_a_disconnected = true ;
1459
1459
drain_msg_events_on_disconnect ! ( 0 ) ;
1460
1460
}
1461
1461
} ,
1462
1462
0x0d => {
1463
1463
if !chan_b_disconnected {
1464
- nodes[ 1 ] . peer_disconnected ( & nodes[ 2 ] . get_our_node_id ( ) ) ;
1465
- nodes[ 2 ] . peer_disconnected ( & nodes[ 1 ] . get_our_node_id ( ) ) ;
1464
+ nodes[ 1 ] . peer_disconnected ( nodes[ 2 ] . get_our_node_id ( ) ) ;
1465
+ nodes[ 2 ] . peer_disconnected ( nodes[ 1 ] . get_our_node_id ( ) ) ;
1466
1466
chan_b_disconnected = true ;
1467
1467
drain_msg_events_on_disconnect ! ( 2 ) ;
1468
1468
}
@@ -1474,13 +1474,13 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
1474
1474
networks : None ,
1475
1475
remote_network_address : None ,
1476
1476
} ;
1477
- nodes[ 0 ] . peer_connected ( & nodes[ 1 ] . get_our_node_id ( ) , & init_1, true ) . unwrap ( ) ;
1477
+ nodes[ 0 ] . peer_connected ( nodes[ 1 ] . get_our_node_id ( ) , & init_1, true ) . unwrap ( ) ;
1478
1478
let init_0 = Init {
1479
1479
features : nodes[ 0 ] . init_features ( ) ,
1480
1480
networks : None ,
1481
1481
remote_network_address : None ,
1482
1482
} ;
1483
- nodes[ 1 ] . peer_connected ( & nodes[ 0 ] . get_our_node_id ( ) , & init_0, false ) . unwrap ( ) ;
1483
+ nodes[ 1 ] . peer_connected ( nodes[ 0 ] . get_our_node_id ( ) , & init_0, false ) . unwrap ( ) ;
1484
1484
chan_a_disconnected = false ;
1485
1485
}
1486
1486
} ,
@@ -1491,13 +1491,13 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
1491
1491
networks : None ,
1492
1492
remote_network_address : None ,
1493
1493
} ;
1494
- nodes[ 1 ] . peer_connected ( & nodes[ 2 ] . get_our_node_id ( ) , & init_2, true ) . unwrap ( ) ;
1494
+ nodes[ 1 ] . peer_connected ( nodes[ 2 ] . get_our_node_id ( ) , & init_2, true ) . unwrap ( ) ;
1495
1495
let init_1 = Init {
1496
1496
features : nodes[ 1 ] . init_features ( ) ,
1497
1497
networks : None ,
1498
1498
remote_network_address : None ,
1499
1499
} ;
1500
- nodes[ 2 ] . peer_connected ( & nodes[ 1 ] . get_our_node_id ( ) , & init_1, false ) . unwrap ( ) ;
1500
+ nodes[ 2 ] . peer_connected ( nodes[ 1 ] . get_our_node_id ( ) , & init_1, false ) . unwrap ( ) ;
1501
1501
chan_b_disconnected = false ;
1502
1502
}
1503
1503
} ,
@@ -1534,7 +1534,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
1534
1534
1535
1535
0x2c => {
1536
1536
if !chan_a_disconnected {
1537
- nodes[ 1 ] . peer_disconnected ( & nodes[ 0 ] . get_our_node_id ( ) ) ;
1537
+ nodes[ 1 ] . peer_disconnected ( nodes[ 0 ] . get_our_node_id ( ) ) ;
1538
1538
chan_a_disconnected = true ;
1539
1539
push_excess_b_events ! (
1540
1540
nodes[ 1 ] . get_and_clear_pending_msg_events( ) . drain( ..) ,
@@ -1550,14 +1550,14 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
1550
1550
} ,
1551
1551
0x2d => {
1552
1552
if !chan_a_disconnected {
1553
- nodes[ 0 ] . peer_disconnected ( & nodes[ 1 ] . get_our_node_id ( ) ) ;
1553
+ nodes[ 0 ] . peer_disconnected ( nodes[ 1 ] . get_our_node_id ( ) ) ;
1554
1554
chan_a_disconnected = true ;
1555
1555
nodes[ 0 ] . get_and_clear_pending_msg_events ( ) ;
1556
1556
ab_events. clear ( ) ;
1557
1557
ba_events. clear ( ) ;
1558
1558
}
1559
1559
if !chan_b_disconnected {
1560
- nodes[ 2 ] . peer_disconnected ( & nodes[ 1 ] . get_our_node_id ( ) ) ;
1560
+ nodes[ 2 ] . peer_disconnected ( nodes[ 1 ] . get_our_node_id ( ) ) ;
1561
1561
chan_b_disconnected = true ;
1562
1562
nodes[ 2 ] . get_and_clear_pending_msg_events ( ) ;
1563
1563
bc_events. clear ( ) ;
@@ -1570,7 +1570,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
1570
1570
} ,
1571
1571
0x2e => {
1572
1572
if !chan_b_disconnected {
1573
- nodes[ 1 ] . peer_disconnected ( & nodes[ 2 ] . get_our_node_id ( ) ) ;
1573
+ nodes[ 1 ] . peer_disconnected ( nodes[ 2 ] . get_our_node_id ( ) ) ;
1574
1574
chan_b_disconnected = true ;
1575
1575
push_excess_b_events ! (
1576
1576
nodes[ 1 ] . get_and_clear_pending_msg_events( ) . drain( ..) ,
@@ -1759,13 +1759,13 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
1759
1759
networks : None ,
1760
1760
remote_network_address : None ,
1761
1761
} ;
1762
- nodes[ 0 ] . peer_connected ( & nodes[ 1 ] . get_our_node_id ( ) , & init_1, true ) . unwrap ( ) ;
1762
+ nodes[ 0 ] . peer_connected ( nodes[ 1 ] . get_our_node_id ( ) , & init_1, true ) . unwrap ( ) ;
1763
1763
let init_0 = Init {
1764
1764
features : nodes[ 0 ] . init_features ( ) ,
1765
1765
networks : None ,
1766
1766
remote_network_address : None ,
1767
1767
} ;
1768
- nodes[ 1 ] . peer_connected ( & nodes[ 0 ] . get_our_node_id ( ) , & init_0, false ) . unwrap ( ) ;
1768
+ nodes[ 1 ] . peer_connected ( nodes[ 0 ] . get_our_node_id ( ) , & init_0, false ) . unwrap ( ) ;
1769
1769
chan_a_disconnected = false ;
1770
1770
}
1771
1771
if chan_b_disconnected {
@@ -1774,13 +1774,13 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
1774
1774
networks : None ,
1775
1775
remote_network_address : None ,
1776
1776
} ;
1777
- nodes[ 1 ] . peer_connected ( & nodes[ 2 ] . get_our_node_id ( ) , & init_2, true ) . unwrap ( ) ;
1777
+ nodes[ 1 ] . peer_connected ( nodes[ 2 ] . get_our_node_id ( ) , & init_2, true ) . unwrap ( ) ;
1778
1778
let init_1 = Init {
1779
1779
features : nodes[ 1 ] . init_features ( ) ,
1780
1780
networks : None ,
1781
1781
remote_network_address : None ,
1782
1782
} ;
1783
- nodes[ 2 ] . peer_connected ( & nodes[ 1 ] . get_our_node_id ( ) , & init_1, false ) . unwrap ( ) ;
1783
+ nodes[ 2 ] . peer_connected ( nodes[ 1 ] . get_our_node_id ( ) , & init_1, false ) . unwrap ( ) ;
1784
1784
chan_b_disconnected = false ;
1785
1785
}
1786
1786
0 commit comments