Revert "Stop using CallAllUnordered in peer_set::add_initial_peers (#1705)"

This reverts commit 241c7ad849.
This commit is contained in:
teor 2021-02-15 11:31:59 +10:00
parent e8d8a49f41
commit a02a00a3f5
1 changed files with 3 additions and 4 deletions

View File

@ -194,10 +194,9 @@ where
S::Future: Send + 'static,
{
info!(?initial_peers, "Connecting to initial peer set");
let mut handshakes = initial_peers
.iter()
.map(|request| connector.clone().oneshot(*request))
.collect::<futures::stream::FuturesUnordered<_>>();
use tower::util::CallAllUnordered;
let addr_stream = futures::stream::iter(initial_peers.into_iter());
let mut handshakes = CallAllUnordered::new(connector, addr_stream);
while let Some(handshake_result) = handshakes.next().await {
tx.send(handshake_result).await?;