aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/pss
diff options
context:
space:
mode:
authorViktor TrĂ³n <viktor.tron@gmail.com>2019-01-10 10:36:19 +0800
committerGitHub <noreply@github.com>2019-01-10 10:36:19 +0800
commit6df3e4eeb0dda986aef3f71335151fa63c06f6d3 (patch)
treebefe88b3e0d044281037cd4fcaaab09d32338d6a /swarm/pss
parentd70c4faf20d5533e30eec5cbb9b5180eb837b78c (diff)
downloaddexon-6df3e4eeb0dda986aef3f71335151fa63c06f6d3.tar
dexon-6df3e4eeb0dda986aef3f71335151fa63c06f6d3.tar.gz
dexon-6df3e4eeb0dda986aef3f71335151fa63c06f6d3.tar.bz2
dexon-6df3e4eeb0dda986aef3f71335151fa63c06f6d3.tar.lz
dexon-6df3e4eeb0dda986aef3f71335151fa63c06f6d3.tar.xz
dexon-6df3e4eeb0dda986aef3f71335151fa63c06f6d3.tar.zst
dexon-6df3e4eeb0dda986aef3f71335151fa63c06f6d3.zip
swarm/network: remove isproxbin bool from kad.Each* iterfunc (#18239)
* swarm/network, swarm/pss: remove isproxbin bool from kad.Each* iterfunc * swarm/network: restore comment and unskip snapshot sync tests
Diffstat (limited to 'swarm/pss')
-rw-r--r--swarm/pss/pss.go2
-rw-r--r--swarm/pss/pss_test.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/swarm/pss/pss.go b/swarm/pss/pss.go
index 631d27f09..bee64b0df 100644
--- a/swarm/pss/pss.go
+++ b/swarm/pss/pss.go
@@ -964,7 +964,7 @@ func (p *Pss) forward(msg *PssMsg) error {
onlySendOnce = true
}
- p.Kademlia.EachConn(to, addressLength*8, func(sp *network.Peer, po int, _ bool) bool {
+ p.Kademlia.EachConn(to, addressLength*8, func(sp *network.Peer, po int) bool {
if po < broadcastThreshold && sent > 0 {
return false // stop iterating
}
diff --git a/swarm/pss/pss_test.go b/swarm/pss/pss_test.go
index ec46504c2..b0753ad17 100644
--- a/swarm/pss/pss_test.go
+++ b/swarm/pss/pss_test.go
@@ -491,12 +491,12 @@ func TestAddressMatchProx(t *testing.T) {
// meanwhile test regression for kademlia since we are compiling the test parameters from different packages
var proxes int
var conns int
- kad.EachConn(nil, peerCount, func(p *network.Peer, po int, prox bool) bool {
+ depth := kad.NeighbourhoodDepth()
+ kad.EachConn(nil, peerCount, func(p *network.Peer, po int) bool {
conns++
- if prox {
+ if po >= depth {
proxes++
}
- log.Trace("kadconn", "po", po, "peer", p, "prox", prox)
return true
})
if proxes != nnPeerCount {