mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
p2p/discutil: document higher-seq behavior of ReadNodes
This commit is contained in:
parent
f238fc939a
commit
ca8c445c4b
1 changed files with 1 additions and 0 deletions
|
|
@ -50,6 +50,7 @@ func ReadNodes(ctx context.Context, it Iterator, n int) []*enode.Node {
|
||||||
if node == nil {
|
if node == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
// Remove duplicates, keeping the node with higher seq.
|
||||||
prevNode, ok := seen[node.ID()]
|
prevNode, ok := seen[node.ID()]
|
||||||
if ok && prevNode.Seq() > node.Seq() {
|
if ok && prevNode.Seq() > node.Seq() {
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue