fix: only attempt to update kademlia for new bootstrap addresses
@@ -607,12 +607,13 @@ impl<Types: IpfsTypes> Behaviour<Types> {
addr: MultiaddrWithPeerId,
) -> Result<Multiaddr, anyhow::Error> {
let ret = addr.clone().into();
- self.swarm.bootstrappers.insert(addr.clone());
+ if self.swarm.bootstrappers.insert(addr.clone()) {
let MultiaddrWithPeerId {
- multiaddr: _,
+ multiaddr: ma,
peer_id,
} = addr.clone();
- self.kademlia.add_address(&peer_id, addr.into());
+ self.kademlia.add_address(&peer_id, ma.into());
+ }
Ok(ret)
}
