diff --git a/p2p/peer.go b/p2p/peer.go index 94da74b503..1dc3a4b2a6 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -349,6 +349,7 @@ func (p *Peer) handleCryptoHandshake() (err error) { // this bit handles the handshake and creates a secure communications channel with if sessionToken, crw, err = crypto.NewSession(bufio.NewReader(p.conn), p.conn, p.PublicKey(), sessionToken, initiator); err != nil { p.Errorf("unable to setup secure session: %v", err) + return } default: err = fmt.Errorf("unrecognised crypto type %v", p.CryptoType)