swarm/network/stream: refactor to kad.EachConn

This commit is contained in:
Fabio Barone 2019-01-10 15:28:32 -05:00
parent 89d07e193c
commit ed3dd97863

View file

@ -515,7 +515,7 @@ func (r *Registry) requestPeerSubscriptions(kad *network.Kademlia, subs map[enod
// request subscriptions for all nodes and bins // request subscriptions for all nodes and bins
// nil as base takes the node's base; we need to pass 255 as `EachConn` runs // nil as base takes the node's base; we need to pass 255 as `EachConn` runs
// from deepest bins backwards // from deepest bins backwards
kad.EachConn(nil, 255, func(p *network.Peer, po int, _ bool) bool { kad.EachConn(nil, 255, func(p *network.Peer, po int) bool {
//if the peer's bin is shallower than the kademlia depth, //if the peer's bin is shallower than the kademlia depth,
//only the peer's bin should be subscribed //only the peer's bin should be subscribed
if po < kadDepth { if po < kadDepth {