diff options
author | Felix Lange <fjl@twurst.com> | 2015-04-13 23:06:19 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-04-13 23:06:19 +0800 |
commit | 79a6782c1c4a056b27d2c242f656dfcf5633ae3f (patch) | |
tree | 03409df925eac9a5c724cc5d36f14c6e40c29527 /p2p | |
parent | faa2747809ddce7e7b121926ae7dece8fbecae52 (diff) | |
download | dexon-79a6782c1c4a056b27d2c242f656dfcf5633ae3f.tar.gz dexon-79a6782c1c4a056b27d2c242f656dfcf5633ae3f.tar.zst dexon-79a6782c1c4a056b27d2c242f656dfcf5633ae3f.zip |
p2p: fix goroutine leak when handshake read fails
This regression was introduced in b3c058a9e4e9.
Diffstat (limited to 'p2p')
-rw-r--r-- | p2p/handshake.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/p2p/handshake.go b/p2p/handshake.go index 43361364f..79395f23f 100644 --- a/p2p/handshake.go +++ b/p2p/handshake.go @@ -115,7 +115,7 @@ func setupOutboundConn(fd net.Conn, prv *ecdsa.PrivateKey, our *protoHandshake, // returning the handshake read error. If the remote side // disconnects us early with a valid reason, we should return it // as the error so it can be tracked elsewhere. - werr := make(chan error) + werr := make(chan error, 1) go func() { werr <- Send(rw, handshakeMsg, our) }() rhs, err := readProtocolHandshake(rw, secrets.RemoteID, our) if err != nil { |