Commit c0f60e24 authored by metacertain's avatar metacertain Committed by GitHub

feat: constantly monitor depth during kademlia saturation (#1907)

parent 1b0839dd
......@@ -294,10 +294,10 @@ func (k *Kad) connectNeighbours(wg *sync.WaitGroup, peerConnChan chan<- *peerCon
// The topology.EachPeerFunc doesn't return an error
// so we ignore the error returned from EachBinRev.
depth := k.NeighborhoodDepth()
_ = k.knownPeers.EachBinRev(func(addr swarm.Address, po uint8) (bool, bool, error) {
depth := k.NeighborhoodDepth()
if po < depth {
return false, true, nil
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment