From c3f17e61722aab83663742a680d8c36751210329 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 7 May 2026 18:54:50 +0200 Subject: [PATCH] p2p/discover: update --- p2p/discover/table.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/p2p/discover/table.go b/p2p/discover/table.go index 835f27d223..7781b5df6b 100644 --- a/p2p/discover/table.go +++ b/p2p/discover/table.go @@ -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 } }