mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-08 07:58:40 +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
|
||||
}
|
||||
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()
|
||||
defer sub.Unsubscribe()
|
||||
}
|
||||
tab.mutex.Unlock()
|
||||
|
||||
// Wait for table event.
|
||||
_, ok := <-notify
|
||||
if !ok {
|
||||
if _, ok := <-notify; !ok {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue