[DEV-93] Backported 'peer: ensure the version negotiation goroutine will always exit'. (#50)

Original PR: https://github.com/btcsuite/btcd/pull/1228/files
This commit is contained in:
stasatdaglabs 2018-08-23 15:25:58 +03:00 committed by Svarog
parent ce35aabb70
commit 9438bd0d2e

View File

@ -2010,7 +2010,7 @@ func (p *Peer) Disconnect() {
func (p *Peer) start() error {
log.Tracef("Starting peer %s", p)
negotiateErr := make(chan error)
negotiateErr := make(chan error, 1)
go func() {
if p.inbound {
negotiateErr <- p.negotiateInboundProtocol()