mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-08 07:58:40 +00:00
p2p/discover: fix deadlock in waitForNodes by buffering subscriber channel
This commit is contained in:
parent
aaa2b66285
commit
d15e833a43
1 changed files with 1 additions and 1 deletions
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue