-
Notifications
You must be signed in to change notification settings - Fork 780
Description
Bug Report
version: 0.34.27
While diving into the privval package source code as part of an investigation into horcrux we discovered that the "accept connection logic" is unclear.
See source. Writing to the unbuffered channel sl.connectRequestCh after attempting to accept a connection in SignerListenerEndpoint.serviceLoop has no affect. This is because a single goroutine cannot read and write to the same unbuffered channel, it can only do that with buffered channels.
It would therefore be clearer to remove that select statement since it never actually writes to the channel.
If the reasoning behind the serviceLoop is to successfully accept one connection for each connectRequest then one could change connectRequestCh into a buffered channel with length 1 and only write to it when acceptNewConnection errored.