Fix comments from Michael

This commit is contained in:
Paul Hauner 2019-09-26 10:46:56 +10:00
parent 4ba6e916d5
commit b4806d27eb
No known key found for this signature in database
GPG Key ID: 5E2CFF9B75FA63DF
4 changed files with 18 additions and 29 deletions

View File

@ -68,10 +68,6 @@ where
pub websocket_exit_signal: Option<Signal>,
/// The clients logger.
log: slog::Logger,
/*
/// Marker to pin the beacon chain generics.
phantom: PhantomData<BeaconChainTypes>,
*/
}
impl<S, E> Client<S, E>

View File

@ -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));

View File

@ -73,11 +73,7 @@ impl<T: BeaconChainTypes + 'static> MessageHandler<T> {
.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)

View File

@ -648,26 +648,24 @@ impl<T: BeaconChainTypes> SyncManager<T> {
// 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,
);
}
}
}