Skip to content

Commit

Permalink
chore: dial instead of add into RT
Browse files Browse the repository at this point in the history
  • Loading branch information
maqi committed Dec 12, 2024
1 parent 8ced999 commit 9a8c832
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ant-networking/src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(());
}
Expand Down

0 comments on commit 9a8c832

Please sign in to comment.