Simplify calling `add_initial_peers` (#2945)
Co-authored-by: Conrado Gouvea <conrado@zfnd.org>
This commit is contained in:
parent
c7a5db3c24
commit
c2734f5661
|
@ -144,7 +144,7 @@ where
|
||||||
let config = config.clone();
|
let config = config.clone();
|
||||||
let outbound_connector = outbound_connector.clone();
|
let outbound_connector = outbound_connector.clone();
|
||||||
let peerset_tx = peerset_tx.clone();
|
let peerset_tx = peerset_tx.clone();
|
||||||
async move { add_initial_peers(&config, outbound_connector, peerset_tx).await }.boxed()
|
add_initial_peers(config, outbound_connector, peerset_tx)
|
||||||
};
|
};
|
||||||
|
|
||||||
let initial_peers_join = tokio::spawn(initial_peers_fut.instrument(Span::current()));
|
let initial_peers_join = tokio::spawn(initial_peers_fut.instrument(Span::current()));
|
||||||
|
@ -196,7 +196,7 @@ where
|
||||||
/// then send the resulting peer connections over `peerset_tx`.
|
/// then send the resulting peer connections over `peerset_tx`.
|
||||||
#[instrument(skip(config, outbound_connector, peerset_tx))]
|
#[instrument(skip(config, outbound_connector, peerset_tx))]
|
||||||
async fn add_initial_peers<S>(
|
async fn add_initial_peers<S>(
|
||||||
config: &Config,
|
config: Config,
|
||||||
outbound_connector: S,
|
outbound_connector: S,
|
||||||
mut peerset_tx: mpsc::Sender<PeerChange>,
|
mut peerset_tx: mpsc::Sender<PeerChange>,
|
||||||
) -> Result<ActiveConnectionCounter, BoxError>
|
) -> Result<ActiveConnectionCounter, BoxError>
|
||||||
|
@ -208,7 +208,7 @@ where
|
||||||
> + Clone,
|
> + Clone,
|
||||||
S::Future: Send + 'static,
|
S::Future: Send + 'static,
|
||||||
{
|
{
|
||||||
let initial_peers = limit_initial_peers(config).await;
|
let initial_peers = limit_initial_peers(&config).await;
|
||||||
|
|
||||||
let mut handshake_success_total: usize = 0;
|
let mut handshake_success_total: usize = 0;
|
||||||
let mut handshake_error_total: usize = 0;
|
let mut handshake_error_total: usize = 0;
|
||||||
|
|
Loading…
Reference in New Issue