mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
p2p/discover: rename lookup.next to 'advance'
This commit is contained in:
parent
d487c421e0
commit
61523364dd
1 changed files with 4 additions and 4 deletions
|
|
@ -57,14 +57,14 @@ func newLookup(ctx context.Context, tab *Table, target enode.ID, q queryFunc) *l
|
||||||
|
|
||||||
// run runs the lookup to completion and returns the closest nodes found.
|
// run runs the lookup to completion and returns the closest nodes found.
|
||||||
func (it *lookup) run() []*enode.Node {
|
func (it *lookup) run() []*enode.Node {
|
||||||
for it.next() {
|
for it.advance() {
|
||||||
}
|
}
|
||||||
return unwrapNodes(it.result.entries)
|
return unwrapNodes(it.result.entries)
|
||||||
}
|
}
|
||||||
|
|
||||||
// next advances the lookup until any new nodes have been found.
|
// advance advances the lookup until any new nodes have been found.
|
||||||
// It returns false when the lookup has ended.
|
// It returns false when the lookup has ended.
|
||||||
func (it *lookup) next() bool {
|
func (it *lookup) advance() bool {
|
||||||
for it.startQueries() {
|
for it.startQueries() {
|
||||||
select {
|
select {
|
||||||
case nodes := <-it.replyCh:
|
case nodes := <-it.replyCh:
|
||||||
|
|
@ -194,7 +194,7 @@ func (it *lookupIterator) Next() bool {
|
||||||
it.lookup = it.nextLookup(it.ctx)
|
it.lookup = it.nextLookup(it.ctx)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if !it.lookup.next() {
|
if !it.lookup.advance() {
|
||||||
it.lookup = nil
|
it.lookup = nil
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue