Skip to content

Commit

Permalink
remove reduntant span
Browse files Browse the repository at this point in the history
  • Loading branch information
zeegomo committed Sep 24, 2021
1 parent bd02ef2 commit 8a39e14
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions jormungandr/src/network/client/mod.rs
Expand Up @@ -23,7 +23,7 @@ use chain_network::data::block::{BlockEvent, BlockIds, ChainPullRequest};

use futures::prelude::*;
use futures::ready;
use tracing::{instrument, span, Level, Span};
use tracing::{instrument, Span};
use tracing_futures::Instrument;

use std::pin::Pin;
Expand Down Expand Up @@ -244,9 +244,6 @@ impl Client {

#[instrument(level = "debug", skip(self))]
fn upload_blocks(&mut self, block_ids: BlockIds) -> Result<(), ()> {
let span = span!(Level::DEBUG, "upload_blocks", kind = "UploadBlocks");
let _enter = span.enter();

if block_ids.is_empty() {
tracing::info!("peer has sent an empty block solicitation");
return Err(());
Expand All @@ -263,7 +260,7 @@ impl Client {
block_ids[0]
);
let (reply_handle, future) = intercom::stream_reply(buffer_sizes::outbound::BLOCKS);
let future = future.instrument(span.clone());
let future = future.in_current_span();
debug_assert!(self.incoming_solicitation.is_none());
self.incoming_solicitation = Some(ClientMsg::GetBlocks(block_ids, reply_handle));
let mut client = self.inner.clone();
Expand Down Expand Up @@ -291,7 +288,7 @@ impl Client {
}
}
}
.instrument(span.clone()),
.in_current_span(),
);
Ok(())
}
Expand Down

0 comments on commit 8a39e14

Please sign in to comment.