@@ -806,13 +806,13 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
806806 networks: None ,
807807 remote_network_address: None ,
808808 } ;
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( ) ;
810810 let init_src = Init {
811811 features: $source. init_features( ) ,
812812 networks: None ,
813813 remote_network_address: None ,
814814 } ;
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( ) ;
816816
817817 $source. create_channel( $dest. get_our_node_id( ) , 100_000 , 42 , 0 , None , None ) . unwrap( ) ;
818818 let open_channel = {
@@ -825,7 +825,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
825825 }
826826 } ;
827827
828- $dest. handle_open_channel( & $source. get_our_node_id( ) , & open_channel) ;
828+ $dest. handle_open_channel( $source. get_our_node_id( ) , & open_channel) ;
829829 let accept_channel = {
830830 if anchors {
831831 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) {
860860 }
861861 } ;
862862
863- $source. handle_accept_channel( & $dest. get_our_node_id( ) , & accept_channel) ;
863+ $source. handle_accept_channel( $dest. get_our_node_id( ) , & accept_channel) ;
864864 let funding_output;
865865 {
866866 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) {
904904 panic!( "Wrong event type" ) ;
905905 }
906906 } ;
907- $dest. handle_funding_created( & $source. get_our_node_id( ) , & funding_created) ;
907+ $dest. handle_funding_created( $source. get_our_node_id( ) , & funding_created) ;
908908
909909 let funding_signed = {
910910 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) {
923923 panic!( "Wrong event type" ) ;
924924 }
925925
926- $source. handle_funding_signed( & $dest. get_our_node_id( ) , & funding_signed) ;
926+ $source. handle_funding_signed( $dest. get_our_node_id( ) , & funding_signed) ;
927927 let events = $source. get_and_clear_pending_events( ) ;
928928 assert_eq!( events. len( ) , 1 ) ;
929929 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) {
963963 {
964964 for node in $nodes. iter( ) {
965965 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) ;
967967 }
968968 }
969969 } else {
@@ -1134,7 +1134,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
11341134 for update_add in update_add_htlcs. iter( ) {
11351135 out. locked_write( format!( "Delivering update_add_htlc to node {}.\n " , idx) . as_bytes( ) ) ;
11361136 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) ;
11381138 } else {
11391139 // Corrupt the update_add_htlc message so that its HMAC
11401140 // check will fail and we generate a
@@ -1143,24 +1143,24 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
11431143 let mut msg_ser = update_add. encode( ) ;
11441144 msg_ser[ 1000 ] ^= 0xff ;
11451145 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) ;
11471147 }
11481148 }
11491149 for update_fulfill in update_fulfill_htlcs. iter( ) {
11501150 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) ;
11521152 }
11531153 for update_fail in update_fail_htlcs. iter( ) {
11541154 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) ;
11561156 }
11571157 for update_fail_malformed in update_fail_malformed_htlcs. iter( ) {
11581158 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) ;
11601160 }
11611161 if let Some ( msg) = update_fee {
11621162 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) ;
11641164 }
11651165 let processed_change = !update_add_htlcs. is_empty( ) || !update_fulfill_htlcs. is_empty( ) ||
11661166 !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) {
11771177 break ;
11781178 }
11791179 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) ;
11811181 break ;
11821182 }
11831183 }
@@ -1186,15 +1186,15 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
11861186 for ( idx, dest) in nodes. iter( ) . enumerate( ) {
11871187 if dest. get_our_node_id( ) == * node_id {
11881188 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) ;
11901190 }
11911191 }
11921192 } ,
11931193 events:: MessageSendEvent :: SendChannelReestablish { ref node_id, ref msg } => {
11941194 for ( idx, dest) in nodes. iter( ) . enumerate( ) {
11951195 if dest. get_our_node_id( ) == * node_id {
11961196 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) ;
11981198 }
11991199 }
12001200 } ,
@@ -1453,16 +1453,16 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
14531453
14541454 0x0c => {
14551455 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 ( ) ) ;
14581458 chan_a_disconnected = true ;
14591459 drain_msg_events_on_disconnect ! ( 0 ) ;
14601460 }
14611461 } ,
14621462 0x0d => {
14631463 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 ( ) ) ;
14661466 chan_b_disconnected = true ;
14671467 drain_msg_events_on_disconnect ! ( 2 ) ;
14681468 }
@@ -1474,13 +1474,13 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
14741474 networks : None ,
14751475 remote_network_address : None ,
14761476 } ;
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 ( ) ;
14781478 let init_0 = Init {
14791479 features : nodes[ 0 ] . init_features ( ) ,
14801480 networks : None ,
14811481 remote_network_address : None ,
14821482 } ;
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 ( ) ;
14841484 chan_a_disconnected = false ;
14851485 }
14861486 } ,
@@ -1491,13 +1491,13 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
14911491 networks : None ,
14921492 remote_network_address : None ,
14931493 } ;
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 ( ) ;
14951495 let init_1 = Init {
14961496 features : nodes[ 1 ] . init_features ( ) ,
14971497 networks : None ,
14981498 remote_network_address : None ,
14991499 } ;
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 ( ) ;
15011501 chan_b_disconnected = false ;
15021502 }
15031503 } ,
@@ -1534,7 +1534,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
15341534
15351535 0x2c => {
15361536 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 ( ) ) ;
15381538 chan_a_disconnected = true ;
15391539 push_excess_b_events ! (
15401540 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) {
15501550 } ,
15511551 0x2d => {
15521552 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 ( ) ) ;
15541554 chan_a_disconnected = true ;
15551555 nodes[ 0 ] . get_and_clear_pending_msg_events ( ) ;
15561556 ab_events. clear ( ) ;
15571557 ba_events. clear ( ) ;
15581558 }
15591559 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 ( ) ) ;
15611561 chan_b_disconnected = true ;
15621562 nodes[ 2 ] . get_and_clear_pending_msg_events ( ) ;
15631563 bc_events. clear ( ) ;
@@ -1570,7 +1570,7 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
15701570 } ,
15711571 0x2e => {
15721572 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 ( ) ) ;
15741574 chan_b_disconnected = true ;
15751575 push_excess_b_events ! (
15761576 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) {
17591759 networks : None ,
17601760 remote_network_address : None ,
17611761 } ;
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 ( ) ;
17631763 let init_0 = Init {
17641764 features : nodes[ 0 ] . init_features ( ) ,
17651765 networks : None ,
17661766 remote_network_address : None ,
17671767 } ;
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 ( ) ;
17691769 chan_a_disconnected = false ;
17701770 }
17711771 if chan_b_disconnected {
@@ -1774,13 +1774,13 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out, anchors: bool) {
17741774 networks : None ,
17751775 remote_network_address : None ,
17761776 } ;
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 ( ) ;
17781778 let init_1 = Init {
17791779 features : nodes[ 1 ] . init_features ( ) ,
17801780 networks : None ,
17811781 remote_network_address : None ,
17821782 } ;
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 ( ) ;
17841784 chan_b_disconnected = false ;
17851785 }
17861786
0 commit comments