mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: make FetchClient Cloneable (#970)
This commit is contained in:
@ -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<FetchClient>,
|
||||
client: FetchClient,
|
||||
id: BlockHashOrNumber,
|
||||
) -> eyre::Result<SealedHeader> {
|
||||
let request = HeadersRequest {
|
||||
|
||||
@ -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<DownloadRequest>,
|
||||
|
||||
Reference in New Issue
Block a user