Browse Source

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

swarm: externalize secio handshake errors
pull/75/merge
Jeromy Johnson 8 years ago
committed by GitHub
parent
commit
b45c89792d
  1. 3
      p2p/net/swarm/swarm_dial.go

3
p2p/net/swarm/swarm_dial.go

@ -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...

Loading…
Cancel
Save