From d15e833a438228d793f1a542fa7bf31ff484d743 Mon Sep 17 00:00:00 2001 From: Vansh Sahay Date: Wed, 6 May 2026 20:47:01 +0530 Subject: [PATCH] p2p/discover: fix deadlock in waitForNodes by buffering subscriber channel --- p2p/discover/table.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/discover/table.go b/p2p/discover/table.go index 721cd7b589..4a0fdd9422 100644 --- a/p2p/discover/table.go +++ b/p2p/discover/table.go @@ -769,7 +769,7 @@ func (tab *Table) waitForNodes(ctx context.Context, n int) error { } if ch == nil { // Init subscription. - ch = make(chan *enode.Node) + ch = make(chan *enode.Node, 1) sub := tab.nodeFeed.Subscribe(ch) defer sub.Unsubscribe() }