diff options
author | Felix Lange <fjl@twurst.com> | 2015-02-09 18:02:32 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-02-09 18:02:32 +0800 |
commit | 9915d3c3be831fa2c95ac277459945d969bd7b06 (patch) | |
tree | 600bbf3c5bc3bf995176fdbecb31d354be60d9ee /p2p/discover/udp.go | |
parent | 028775a0863946c1e9ad51fe7b22faa5c59b2605 (diff) | |
download | go-tangerine-9915d3c3be831fa2c95ac277459945d969bd7b06.tar go-tangerine-9915d3c3be831fa2c95ac277459945d969bd7b06.tar.gz go-tangerine-9915d3c3be831fa2c95ac277459945d969bd7b06.tar.bz2 go-tangerine-9915d3c3be831fa2c95ac277459945d969bd7b06.tar.lz go-tangerine-9915d3c3be831fa2c95ac277459945d969bd7b06.tar.xz go-tangerine-9915d3c3be831fa2c95ac277459945d969bd7b06.tar.zst go-tangerine-9915d3c3be831fa2c95ac277459945d969bd7b06.zip |
p2p/discover: deflake UDP tests
Diffstat (limited to 'p2p/discover/udp.go')
-rw-r--r-- | p2p/discover/udp.go | 5 |
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) } } |