mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-11 17:31:35 +00:00
p2p/discover: update
This commit is contained in:
parent
0e9e8a479a
commit
c3f17e6172
1 changed files with 3 additions and 3 deletions
|
|
@ -797,15 +797,15 @@ func (tab *Table) waitForNodes(ctx context.Context, n int) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if notify == nil {
|
if notify == nil {
|
||||||
// Lazily init the subscription.
|
// Lazily init the subscription. Do this while holding the
|
||||||
|
// lock so we don't miss any events that change the node count.
|
||||||
sub := initsub()
|
sub := initsub()
|
||||||
defer sub.Unsubscribe()
|
defer sub.Unsubscribe()
|
||||||
}
|
}
|
||||||
tab.mutex.Unlock()
|
tab.mutex.Unlock()
|
||||||
|
|
||||||
// Wait for table event.
|
// Wait for table event.
|
||||||
_, ok := <-notify
|
if _, ok := <-notify; !ok {
|
||||||
if !ok {
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue