aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discover/udp.go
diff options
context:
space:
mode:
Diffstat (limited to 'p2p/discover/udp.go')
-rw-r--r--p2p/discover/udp.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/p2p/discover/udp.go b/p2p/discover/udp.go
index 67e349aa4..4ad5d9cc4 100644
--- a/p2p/discover/udp.go
+++ b/p2p/discover/udp.go
@@ -179,10 +179,9 @@ func (t *udp) findnode(to *Node, target NodeID) ([]*Node, error) {
nreceived := 0
errc := t.pending(to.ID, neighborsPacket, func(r interface{}) bool {
reply := r.(*neighbors)
- for i := 0; i < len(reply.Nodes); i++ {
+ for _, n := range reply.Nodes {
nreceived++
- n := reply.Nodes[i]
- if n.ID != t.self.ID && n.isValid() {
+ if n.isValid() {
nodes = append(nodes, n)
}
}