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
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user