peer: ensure goroutine launched during initial handshake exits
This commit fixes a bug which was covered by the recent server refactoring wherein the grouting would be stuck on the send over the message channel in the case that the handshake failed. This blockage would create a deadlock now that the ConnectToPeer method is full synchronous. We fix this issue by ensuring the goroutine properly exits.
This commit is contained in:
parent
84a0806da4
commit
a2545d85dc
1
peer.go
1
peer.go
@ -216,6 +216,7 @@ func (p *peer) Start() error {
|
||||
if err != nil {
|
||||
readErr <- err
|
||||
msgChan <- nil
|
||||
return
|
||||
}
|
||||
readErr <- nil
|
||||
msgChan <- msg
|
||||
|
Loading…
Reference in New Issue
Block a user