p2p/discover: fix some tests

This commit is contained in:
Felix Lange 2024-04-18 10:21:57 +02:00
parent 0a4b314244
commit fad3fe7853
2 changed files with 3 additions and 2 deletions

View file

@ -116,11 +116,12 @@ func fillTable(tab *Table, nodes []*node, setLive bool) {
for _, n := range nodes {
if setLive {
n.livenessChecks = 1
n.isValidatedLive = true
}
tab.addSeenNode(n)
}
}
7
type pingRecorder struct {
mu sync.Mutex
cond *sync.Cond

View file

@ -264,7 +264,7 @@ func TestUDPv4_findnode(t *testing.T) {
n := wrapNode(enode.NewV4(&key.PublicKey, ip, 0, 2000))
// Ensure half of table content isn't verified live yet.
if i > numCandidates/2 {
n.livenessChecks = 1
n.isValidatedLive = true
live[n.ID()] = true
}
nodes.push(n, numCandidates)