diff --git a/swarm/network/kademlia.go b/swarm/network/kademlia.go index c35d55e834..3214e151d1 100644 --- a/swarm/network/kademlia.go +++ b/swarm/network/kademlia.go @@ -684,7 +684,10 @@ func (k *Kademlia) saturation() int { 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) + // 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 + // all bins (except self) are included (0 <= bin <= 255) if po < depth { return false } diff --git a/swarm/network/stream/snapshot_sync_test.go b/swarm/network/stream/snapshot_sync_test.go index 8ee7fd2edf..7a883644b9 100644 --- a/swarm/network/stream/snapshot_sync_test.go +++ b/swarm/network/stream/snapshot_sync_test.go @@ -76,7 +76,6 @@ func dummyRequestFromPeers(_ context.Context, req *network.Request) (*enode.ID, //they are expected to store based on the syncing protocol. //Number of chunks and nodes can be provided via commandline too. func TestSyncingViaGlobalSync(t *testing.T) { - t.Skip("not working") if runtime.GOOS == "darwin" && os.Getenv("TRAVIS") == "true" { t.Skip("Flaky on mac on travis") } @@ -108,7 +107,6 @@ func TestSyncingViaGlobalSync(t *testing.T) { } func TestSyncingViaDirectSubscribe(t *testing.T) { - t.Skip("not working") if runtime.GOOS == "darwin" && os.Getenv("TRAVIS") == "true" { t.Skip("Flaky on mac on travis") }