panic -> error

This commit is contained in:
Juan Batiz-Benet 2014-08-29 23:58:15 -07:00
parent 9338caa9d8
commit e9e13f7fea

View File

@ -397,7 +397,7 @@ func (s *Swarm) GetConnection(id peer.ID, addr *ma.Multiaddr) (*peer.Peer, error
}
if id.Equal(s.local.ID) {
panic("Attempted connection to self!")
return nil, errors.New("Attempted connection to self!")
}
conn, err, reused := s.Dial(p)