diff options
author | Anton Evangelatov <anton.evangelatov@gmail.com> | 2019-01-24 19:02:18 +0800 |
---|---|---|
committer | Rafael Matias <rafael@skyle.net> | 2019-02-19 19:56:30 +0800 |
commit | 4976fcc91a43b5c7047c51a03985887b694f0fbb (patch) | |
tree | c2aef8ce616498f44d38a6a830c211112e0a6d71 /swarm/network/stream/stream.go | |
parent | 878aa58ec66ffc541a80aa65ee35261efa086c9c (diff) | |
download | go-tangerine-4976fcc91a43b5c7047c51a03985887b694f0fbb.tar go-tangerine-4976fcc91a43b5c7047c51a03985887b694f0fbb.tar.gz go-tangerine-4976fcc91a43b5c7047c51a03985887b694f0fbb.tar.bz2 go-tangerine-4976fcc91a43b5c7047c51a03985887b694f0fbb.tar.lz go-tangerine-4976fcc91a43b5c7047c51a03985887b694f0fbb.tar.xz go-tangerine-4976fcc91a43b5c7047c51a03985887b694f0fbb.tar.zst go-tangerine-4976fcc91a43b5c7047c51a03985887b694f0fbb.zip |
swarm: bootnode-mode, new bootnodes and no p2p package discovery (#18498)
(cherry picked from commit bbd120354a8d226b446591eeda9f9462cb9b690a)
Diffstat (limited to 'swarm/network/stream/stream.go')
-rw-r--r-- | swarm/network/stream/stream.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/swarm/network/stream/stream.go b/swarm/network/stream/stream.go index fb571c856..e06048053 100644 --- a/swarm/network/stream/stream.go +++ b/swarm/network/stream/stream.go @@ -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 { |