Skip to content

Commit

Permalink
remove unnecessary clones in bootstrap_from_peer
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-babichenko committed Nov 27, 2020
1 parent 75321e1 commit 57bc4e7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions jormungandr/src/network/bootstrap.rs
Expand Up @@ -87,13 +87,9 @@ pub async fn bootstrap_from_peer(

debug!(logger, "connecting to bootstrap peer {}", peer.connection);

let blockchain1 = blockchain.clone();
let tip1 = tip.clone();
let logger1 = logger.clone();

let mut client = grpc::connect(&peer).await.map_err(Error::Connect)?;

let checkpoints = blockchain1.get_checkpoints(tip1.branch()).await;
let checkpoints = blockchain.get_checkpoints(tip.branch()).await;
let checkpoints = net_data::block::try_ids_from_iter(checkpoints).unwrap();

let remote_tip: Header = client
Expand All @@ -104,7 +100,7 @@ pub async fn bootstrap_from_peer(
let remote_tip = BlockId::try_from(remote_tip.id().as_ref()).unwrap();

info!(
logger1,
logger,
"pulling blocks starting from checkpoints: {:?}; to tip {:?}", checkpoints, remote_tip,
);

Expand Down

0 comments on commit 57bc4e7

Please sign in to comment.