p2p/discover: fix issue found by test

This commit is contained in:
Felix Lange 2023-12-16 03:00:14 +01:00
parent d39ef3c8f4
commit e95a2657f4

View file

@ -471,7 +471,7 @@ func (tab *Table) appendLiveNodes(dist uint, result []*enode.Node) []*enode.Node
tab.mutex.Lock()
defer tab.mutex.Unlock()
for _, n := range tab.bucketAtDistance(int(dist)).entries {
if n.livenessChecks > 1 {
if n.livenessChecks >= 1 {
node := n.Node // avoid handing out pointer to struct field
result = append(result, &node)
}