p2p/discover: rename to appendLiveNodes

This commit is contained in:
Felix Lange 2023-12-16 02:50:13 +01:00
parent 0d46156af4
commit b5acff0fad
2 changed files with 3 additions and 2 deletions

View file

@ -459,7 +459,8 @@ func (tab *Table) findnodeByID(target enode.ID, nresults int, preferLive bool) *
return nodes
}
func (tab *Table) appendBucketNodes(dist uint, result []*enode.Node) []*enode.Node {
// appendLiveNodes adds nodes at the given distance to the result slice.
func (tab *Table) appendLiveNodes(dist uint, result []*enode.Node) []*enode.Node {
if dist > 256 {
return result
}

View file

@ -861,7 +861,7 @@ func (t *UDPv5) collectTableNodes(rip net.IP, distances []uint, limit int) []*en
continue
}
bn = t.tab.appendBucketNodes(dist, bn[:0])
bn = t.tab.appendLiveNodes(dist, bn[:0])
for _, n := range bn {
// Apply some pre-checks to avoid sending invalid nodes.
// Note liveness is checked by appendBucketNodes.