From db37920f0fac8bf52e4a4d12d72fdba3151697e4 Mon Sep 17 00:00:00 2001 From: lash Date: Thu, 10 Jan 2019 08:39:32 +0100 Subject: [PATCH] swarm/network: Deactivate WaitTillHealthy, unreliable pending suggestpeer --- swarm/network/kademlia.go | 4 ++-- swarm/network/simulation/kademlia_test.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/swarm/network/kademlia.go b/swarm/network/kademlia.go index 20d51b9efe13..341ed20b28d7 100644 --- a/swarm/network/kademlia.go +++ b/swarm/network/kademlia.go @@ -683,7 +683,7 @@ func (k *Kademlia) saturation() int { // TODO move to separate testing tools file func (k *Kademlia) knowNeighbours(addrs [][]byte) (got bool, n int, missing [][]byte) { pm := make(map[string]bool) - depth := depthForPot(k.conns, k.MinProxBinSize, k.base) + depth := depthForPot(k.conns, k.NeighbourhoodSize, k.base) // create a map with all peers at depth and deeper known in the kademlia k.eachAddr(nil, 255, func(p *BzzAddr, po int) bool { // in order deepest to shallowest compared to the kademlia base address @@ -724,7 +724,7 @@ func (k *Kademlia) connectedNeighbours(peers [][]byte) (got bool, n int, missing // in order deepest to shallowest compared to the kademlia base address // all bins (except self) are included (0 <= bin <= 255) depth := depthForPot(k.conns, k.NeighbourhoodSize, k.base) - k.eachConn(nil, 255, func(p *Peer, po int, nn bool) bool { + k.eachConn(nil, 255, func(p *Peer, po int) bool { if po < depth { return false } diff --git a/swarm/network/simulation/kademlia_test.go b/swarm/network/simulation/kademlia_test.go index e8b1eba8a86c..36b244d3d0c4 100644 --- a/swarm/network/simulation/kademlia_test.go +++ b/swarm/network/simulation/kademlia_test.go @@ -28,6 +28,7 @@ import ( ) func TestWaitTillHealthy(t *testing.T) { + t.Skip("WaitTillHealthy depends on discovery, which relies on a reliable SuggestPeer, which is not reliable") sim := New(map[string]ServiceFunc{ "bzz": func(ctx *adapters.ServiceContext, b *sync.Map) (node.Service, func(), error) {