From b4806d27eb576064402a81c39444b096698fc640 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Thu, 26 Sep 2019 10:46:56 +1000 Subject: [PATCH] Fix comments from Michael --- beacon_node/client/src/lib.rs | 4 --- beacon_node/eth2-libp2p/src/service.rs | 1 - beacon_node/network/src/message_handler.rs | 6 +--- beacon_node/network/src/sync/manager.rs | 36 ++++++++++------------ 4 files changed, 18 insertions(+), 29 deletions(-) diff --git a/beacon_node/client/src/lib.rs b/beacon_node/client/src/lib.rs index d7df3e0d6..fc5e9f860 100644 --- a/beacon_node/client/src/lib.rs +++ b/beacon_node/client/src/lib.rs @@ -68,10 +68,6 @@ where pub websocket_exit_signal: Option, /// The clients logger. log: slog::Logger, - /* - /// Marker to pin the beacon chain generics. - phantom: PhantomData, - */ } impl Client diff --git a/beacon_node/eth2-libp2p/src/service.rs b/beacon_node/eth2-libp2p/src/service.rs index bf1ed0123..f9c06a532 100644 --- a/beacon_node/eth2-libp2p/src/service.rs +++ b/beacon_node/eth2-libp2p/src/service.rs @@ -49,7 +49,6 @@ impl Service { }; // load the private key from CLI flag, disk or generate a new one - // let local_private_key = load_private_key(&config, &log); let local_peer_id = PeerId::from(local_keypair.public()); info!(log, "Libp2p Service"; "peer_id" => format!("{:?}", local_peer_id)); diff --git a/beacon_node/network/src/message_handler.rs b/beacon_node/network/src/message_handler.rs index 782d2129e..898304272 100644 --- a/beacon_node/network/src/message_handler.rs +++ b/beacon_node/network/src/message_handler.rs @@ -73,11 +73,7 @@ impl MessageHandler { .for_each(move |msg| Ok(handler.handle_message(msg))) .map_err(move |_| { debug!(log, "Network message handler terminated."); - }), /* - .then(move |_| { - debug!(log.clone(), "Message handler shutdown"); - }), - */ + }), ); Ok(handler_send) diff --git a/beacon_node/network/src/sync/manager.rs b/beacon_node/network/src/sync/manager.rs index 171d0fdf0..9e92ade76 100644 --- a/beacon_node/network/src/sync/manager.rs +++ b/beacon_node/network/src/sync/manager.rs @@ -648,26 +648,24 @@ impl SyncManager { // process queued block requests for (peer_id, block_requests) in self.import_queue.iter_mut() { - { - if block_requests.state == BlockRequestsState::Queued { - let request_id = self.current_req_id; - block_requests.state = BlockRequestsState::Pending(request_id); - self.current_req_id += 1; + if block_requests.state == BlockRequestsState::Queued { + let request_id = self.current_req_id; + block_requests.state = BlockRequestsState::Pending(request_id); + self.current_req_id += 1; - let request = BeaconBlocksRequest { - head_block_root: block_requests.target_head_root, - start_slot: block_requests.current_start_slot.as_u64(), - count: MAX_BLOCKS_PER_REQUEST, - step: 0, - }; - request_blocks( - &mut self.network, - &self.log, - peer_id.clone(), - request_id, - request, - ); - } + let request = BeaconBlocksRequest { + head_block_root: block_requests.target_head_root, + start_slot: block_requests.current_start_slot.as_u64(), + count: MAX_BLOCKS_PER_REQUEST, + step: 0, + }; + request_blocks( + &mut self.network, + &self.log, + peer_id.clone(), + request_id, + request, + ); } } }