From d32710e1ea624b3c175cd40f303c23949429e3f3 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Sun, 22 Jan 2023 21:27:06 +0100 Subject: [PATCH] chore: make FetchClient Cloneable (#970) --- bin/reth/src/p2p/mod.rs | 4 ++-- crates/net/network/src/fetch/client.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/reth/src/p2p/mod.rs b/bin/reth/src/p2p/mod.rs index 1e5fc068e..b863e676b 100644 --- a/bin/reth/src/p2p/mod.rs +++ b/bin/reth/src/p2p/mod.rs @@ -102,7 +102,7 @@ impl Command { .start_network() .await?; - let fetch_client = Arc::new(network.fetch_client().await?); + let fetch_client = network.fetch_client().await?; let retries = self.retries.max(1); let backoff = ConstantBackoff::default().with_max_times(retries); @@ -157,7 +157,7 @@ impl Command { /// Get a single header from network pub async fn get_single_header( &self, - client: Arc, + client: FetchClient, id: BlockHashOrNumber, ) -> eyre::Result { let request = HeadersRequest { diff --git a/crates/net/network/src/fetch/client.rs b/crates/net/network/src/fetch/client.rs index 1294d7bf3..79296a826 100644 --- a/crates/net/network/src/fetch/client.rs +++ b/crates/net/network/src/fetch/client.rs @@ -57,7 +57,7 @@ use tokio::sync::{mpsc::UnboundedSender, oneshot}; // end // end /// ``` -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct FetchClient { /// Sender half of the request channel. pub(crate) request_tx: UnboundedSender,