Commit c5f4cdb6 authored by Jeromy Johnson's avatar Jeromy Johnson Committed by GitHub

Merge pull request #104 from libp2p/fix/secio-hs-errs

swarm: externalize secio handshake errors
parents 5dea71d2 f9b5da1b
......@@ -450,7 +450,8 @@ func (s *Swarm) dialAddr(ctx context.Context, p peer.ID, addr ma.Multiaddr) (con
remotep := connC.RemotePeer()
if remotep != p {
connC.Close()
return nil, fmt.Errorf("misdial to %s through %s (got %s)", p, addr, remotep)
_, err := connC.Read(nil) // should return any potential errors (ex: from secio)
return nil, fmt.Errorf("misdial to %s through %s (got %s): %s", p, addr, remotep, err)
}
// if the connection is to ourselves...
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment