mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-04-12 12:48:33 +00:00
p2p/discover: clarify lookup behavior on empty table
We have changed this behavior, better clarify in comment. Signed-off-by: Csaba Kiraly <csaba.kiraly@gmail.com>
This commit is contained in:
parent
a9f9e0d589
commit
72d3e881b3
1 changed files with 4 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ import (
|
|||
// lookup performs a network search for nodes close to the given target. It approaches the
|
||||
// target by querying nodes that are closer to it on each iteration. The given target does
|
||||
// not need to be an actual node identifier.
|
||||
// lookup on an empty table will return immediately with no nodes.
|
||||
type lookup struct {
|
||||
tab *Table
|
||||
queryfunc queryFunc
|
||||
|
|
@ -142,6 +143,9 @@ func (it *lookup) query(n *enode.Node, reply chan<- []*enode.Node) {
|
|||
|
||||
// lookupIterator performs lookup operations and iterates over all seen nodes.
|
||||
// When a lookup finishes, a new one is created through nextLookup.
|
||||
// LookupIterator waits for table initialization and triggers a table refresh
|
||||
// when necessary.
|
||||
|
||||
type lookupIterator struct {
|
||||
buffer []*enode.Node
|
||||
nextLookup lookupFunc
|
||||
|
|
|
|||
Loading…
Reference in a new issue