diff --git a/ant-networking/src/cmd.rs b/ant-networking/src/cmd.rs index 6171fe0114..99e35136d9 100644 --- a/ant-networking/src/cmd.rs +++ b/ant-networking/src/cmd.rs @@ -507,7 +507,12 @@ impl SwarmDriver { NetworkSwarmCmd::AddPeerAddresses { addresses, sender } => { cmd_string = "AddPeerAddresses"; for (peer, addr) in addresses { - let _update = self.swarm.behaviour_mut().kademlia.add_address(&peer, addr); + if let Some(kbucket) = self.swarm.behaviour_mut().kademlia.kbucket(peer) { + let ilog2 = kbucket.range().0.ilog2(); + let peers = self.bootstrap_peers.entry(ilog2).or_default(); + peers.insert(peer); + } + let _ = self.dial(addr); } let _ = sender.send(()); } diff --git a/autonomi/src/client/mod.rs b/autonomi/src/client/mod.rs index 3f9fb81b94..d72c406e09 100644 --- a/autonomi/src/client/mod.rs +++ b/autonomi/src/client/mod.rs @@ -129,11 +129,18 @@ impl Client { if peers_with_p2p.len() < peers_len { tracing::warn!("Some bootstrap addresses have no peer ID, skipping them"); } - let _ = network.add_peer_addresses(peers_with_p2p).await; + + let network_clone = network.clone(); + let _handle = ant_networking::target_arch::spawn(async move { + if let Err(err) = network_clone.add_peer_addresses(peers_with_p2p).await { + error!("Failed to add addresses with err: {err:?}"); + } + }); Ok(Self { network, client_event_sender: Arc::new(None), + evm_network: Default::default(), }) }