swarm: bootnode-mode, new bootnodes and no p2p package discovery (#18498)

(cherry picked from commit bbd120354a)
This commit is contained in:
Anton Evangelatov
2019-01-24 12:02:18 +01:00
committed by Rafael Matias
parent 878aa58ec6
commit 4976fcc91a
16 changed files with 107 additions and 90 deletions

View File

@@ -516,6 +516,11 @@ func (r *Registry) requestPeerSubscriptions(kad *network.Kademlia, subs map[enod
// nil as base takes the node's base; we need to pass 255 as `EachConn` runs
// from deepest bins backwards
kad.EachConn(nil, 255, func(p *network.Peer, po int) bool {
// nodes that do not provide stream protocol
// should not be subscribed, e.g. bootnodes
if !p.HasCap("stream") {
return true
}
//if the peer's bin is shallower than the kademlia depth,
//only the peer's bin should be subscribed
if po < kadDepth {