perf: use try_join_all when resolving bootnodes (#9886)

This commit is contained in:
Matthias Seitz
2024-07-30 01:40:47 +02:00
committed by GitHub
parent eb2d0a22d9
commit 2bd99faee3

View File

@@ -202,11 +202,8 @@ impl NetworkManager {
let listener_addr = incoming.local_address();
// resolve boot nodes
let mut resolved_boot_nodes = vec![];
for record in &boot_nodes {
let resolved = record.resolve().await?;
resolved_boot_nodes.push(resolved);
}
let resolved_boot_nodes =
futures::future::try_join_all(boot_nodes.iter().map(|record| record.resolve())).await?;
if let Some(disc_config) = discovery_v4_config.as_mut() {
// merge configured boot nodes