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()
|
.start_network()
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let fetch_client = Arc::new(network.fetch_client().await?);
|
let fetch_client = network.fetch_client().await?;
|
||||||
let retries = self.retries.max(1);
|
let retries = self.retries.max(1);
|
||||||
let backoff = ConstantBackoff::default().with_max_times(retries);
|
let backoff = ConstantBackoff::default().with_max_times(retries);
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ impl Command {
|
|||||||
/// Get a single header from network
|
/// Get a single header from network
|
||||||
pub async fn get_single_header(
|
pub async fn get_single_header(
|
||||||
&self,
|
&self,
|
||||||
client: Arc<FetchClient>,
|
client: FetchClient,
|
||||||
id: BlockHashOrNumber,
|
id: BlockHashOrNumber,
|
||||||
) -> eyre::Result<SealedHeader> {
|
) -> eyre::Result<SealedHeader> {
|
||||||
let request = HeadersRequest {
|
let request = HeadersRequest {
|
||||||
|
|||||||
@ -57,7 +57,7 @@ use tokio::sync::{mpsc::UnboundedSender, oneshot};
|
|||||||
// end
|
// end
|
||||||
// end
|
// end
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct FetchClient {
|
pub struct FetchClient {
|
||||||
/// Sender half of the request channel.
|
/// Sender half of the request channel.
|
||||||
pub(crate) request_tx: UnboundedSender<DownloadRequest>,
|
pub(crate) request_tx: UnboundedSender<DownloadRequest>,
|
||||||
|
|||||||
Reference in New Issue
Block a user