mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
p2p/enode: Remove unnecessary loop label
This commit is contained in:
parent
a3829178af
commit
7107c24622
1 changed files with 3 additions and 4 deletions
|
|
@ -453,7 +453,6 @@ func (db *DB) QuerySeeds(n int, maxAge time.Duration) []*Node {
|
||||||
)
|
)
|
||||||
defer it.Release()
|
defer it.Release()
|
||||||
|
|
||||||
seek:
|
|
||||||
for seeks := 0; len(nodes) < n && seeks < n*5; seeks++ {
|
for seeks := 0; len(nodes) < n && seeks < n*5; seeks++ {
|
||||||
// Seek to a random entry. The first byte is incremented by a
|
// Seek to a random entry. The first byte is incremented by a
|
||||||
// random amount each time in order to increase the likelihood
|
// random amount each time in order to increase the likelihood
|
||||||
|
|
@ -466,14 +465,14 @@ seek:
|
||||||
n := nextNode(it)
|
n := nextNode(it)
|
||||||
if n == nil {
|
if n == nil {
|
||||||
id[0] = 0
|
id[0] = 0
|
||||||
continue seek // iterator exhausted
|
continue // iterator exhausted
|
||||||
}
|
}
|
||||||
if now.Sub(db.LastPongReceived(n.ID(), n.IP())) > maxAge {
|
if now.Sub(db.LastPongReceived(n.ID(), n.IP())) > maxAge {
|
||||||
continue seek
|
continue
|
||||||
}
|
}
|
||||||
for i := range nodes {
|
for i := range nodes {
|
||||||
if nodes[i].ID() == n.ID() {
|
if nodes[i].ID() == n.ID() {
|
||||||
continue seek // duplicate
|
continue // duplicate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nodes = append(nodes, n)
|
nodes = append(nodes, n)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue