Skip to content

Commit

Permalink
swarm: fix flaky delivery tests (ethereum#18971)
Browse files Browse the repository at this point in the history
  • Loading branch information
janos authored and nonsense committed Jan 30, 2019
1 parent c5c9cef commit 592bf6a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions swarm/network/stream/delivery.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down
2 changes: 1 addition & 1 deletion swarm/network/stream/delivery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 592bf6a

Please sign in to comment.