mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
p2p/discover: fix some tests
This commit is contained in:
parent
0a4b314244
commit
fad3fe7853
2 changed files with 3 additions and 2 deletions
|
|
@ -116,11 +116,12 @@ func fillTable(tab *Table, nodes []*node, setLive bool) {
|
||||||
for _, n := range nodes {
|
for _, n := range nodes {
|
||||||
if setLive {
|
if setLive {
|
||||||
n.livenessChecks = 1
|
n.livenessChecks = 1
|
||||||
|
n.isValidatedLive = true
|
||||||
}
|
}
|
||||||
tab.addSeenNode(n)
|
tab.addSeenNode(n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
7
|
|
||||||
type pingRecorder struct {
|
type pingRecorder struct {
|
||||||
mu sync.Mutex
|
mu sync.Mutex
|
||||||
cond *sync.Cond
|
cond *sync.Cond
|
||||||
|
|
|
||||||
|
|
@ -264,7 +264,7 @@ func TestUDPv4_findnode(t *testing.T) {
|
||||||
n := wrapNode(enode.NewV4(&key.PublicKey, ip, 0, 2000))
|
n := wrapNode(enode.NewV4(&key.PublicKey, ip, 0, 2000))
|
||||||
// Ensure half of table content isn't verified live yet.
|
// Ensure half of table content isn't verified live yet.
|
||||||
if i > numCandidates/2 {
|
if i > numCandidates/2 {
|
||||||
n.livenessChecks = 1
|
n.isValidatedLive = true
|
||||||
live[n.ID()] = true
|
live[n.ID()] = true
|
||||||
}
|
}
|
||||||
nodes.push(n, numCandidates)
|
nodes.push(n, numCandidates)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue