This PR fixes a race condition in the transport. The problem is the when accepting a new connection, the connect function is called before it potentially needs to Bind to the remote. This leaves a window of opportunity where when calling Send it will think that it is connected even though there is no channel in the table. This will eventually lead to an error being returned at client.go:163 which bubbles up as a DPanic in gossip.go.
This PR fixes a race condition in the transport. The problem is the when accepting a new connection, the
connect
function is called before it potentially needs toBind
to the remote. This leaves a window of opportunity where when callingSend
it will think that it is connected even though there is no channel in the table. This will eventually lead to an error being returned at client.go:163 which bubbles up as aDPanic
in gossip.go.