aboutsummaryrefslogtreecommitdiffstats
path: root/swarm
diff options
context:
space:
mode:
authorJanoš Guljaš <janos@users.noreply.github.com>2019-01-30 21:03:11 +0800
committerRafael Matias <rafael@skyle.net>2019-02-19 19:57:53 +0800
commit3f54994db0654fe28857dc1ffa9becb0e7bbb01e (patch)
tree45f1ca9979cab3b7da8daaa6cb5109f868de172b /swarm
parent2695aa9e0d09e58817d2560ecdbd7b5b67f8f1b0 (diff)
downloaddexon-3f54994db0654fe28857dc1ffa9becb0e7bbb01e.tar
dexon-3f54994db0654fe28857dc1ffa9becb0e7bbb01e.tar.gz
dexon-3f54994db0654fe28857dc1ffa9becb0e7bbb01e.tar.bz2
dexon-3f54994db0654fe28857dc1ffa9becb0e7bbb01e.tar.lz
dexon-3f54994db0654fe28857dc1ffa9becb0e7bbb01e.tar.xz
dexon-3f54994db0654fe28857dc1ffa9becb0e7bbb01e.tar.zst
dexon-3f54994db0654fe28857dc1ffa9becb0e7bbb01e.zip
swarm: fix flaky delivery tests (#18971)
(cherry picked from commit 592bf6a59cac9697f0491b24e5093cb759d7e44c)
Diffstat (limited to 'swarm')
-rw-r--r--swarm/network/stream/delivery.go7
-rw-r--r--swarm/network/stream/delivery_test.go2
2 files changed, 1 insertions, 8 deletions
diff --git a/swarm/network/stream/delivery.go b/swarm/network/stream/delivery.go
index c9a8dc57a..988afcce8 100644
--- a/swarm/network/stream/delivery.go
+++ b/swarm/network/stream/delivery.go
@@ -259,13 +259,6 @@ func (d *Delivery) RequestFromPeers(ctx context.Context, req *network.Request) (
if sp == nil {
return true
}
- // nodes that do not provide stream protocol
- // should not be requested, e.g. bootnodes
- if !p.HasCap("stream") {
- // TODO: if we have no errors, delete this if
- log.Error("Delivery.RequestFromPeers: peer doesn't have stream cap. we should have returned at sp == nil")
- return true
- }
spID = &id
return false
})
diff --git a/swarm/network/stream/delivery_test.go b/swarm/network/stream/delivery_test.go
index 6f6988fa4..6f1ddc659 100644
--- a/swarm/network/stream/delivery_test.go
+++ b/swarm/network/stream/delivery_test.go
@@ -285,7 +285,7 @@ func TestRequestFromPeers(t *testing.T) {
addr := network.RandomAddr()
to := network.NewKademlia(addr.OAddr, network.NewKadParams())
delivery := NewDelivery(to, nil)
- protocolsPeer := protocols.NewPeer(p2p.NewPeer(dummyPeerID, "dummy", []p2p.Cap{{Name: "stream"}}), nil, nil)
+ protocolsPeer := protocols.NewPeer(p2p.NewPeer(dummyPeerID, "dummy", nil), nil, nil)
peer := network.NewPeer(&network.BzzPeer{
BzzAddr: network.RandomAddr(),
LightNode: false,