From fad3fe78534887011860c35bb69971b9cfb8ed6f Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 18 Apr 2024 10:21:57 +0200 Subject: [PATCH] p2p/discover: fix some tests --- p2p/discover/table_util_test.go | 3 ++- p2p/discover/v4_udp_test.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/p2p/discover/table_util_test.go b/p2p/discover/table_util_test.go index 190076c571..6ed4bcda90 100644 --- a/p2p/discover/table_util_test.go +++ b/p2p/discover/table_util_test.go @@ -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 diff --git a/p2p/discover/v4_udp_test.go b/p2p/discover/v4_udp_test.go index 361e379626..ada2786418 100644 --- a/p2p/discover/v4_udp_test.go +++ b/p2p/discover/v4_udp_test.go @@ -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)