@cryptotaxi247 / kubo / commits / a2d55f36b

removed DialAddr

Juan Batiz-Benet committed Oct 11, 2014 at 06:36 UTC a2d55f36bd3895e583a27a7f405b69231e01c20c
1 file changed -25
net/swarm/swarm.go
-25
@@ -11,7 +11,6 @@ import (
11 u "github.com/jbenet/go-ipfs/util"
12
13 context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
14 - ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
14 manet "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr/net"
15 )
16
@@ -142,30 +141,6 @@ func (s *Swarm) Dial(peer *peer.Peer) (*conn.Conn, error) {
141 return c, nil
142 }
143
145 -// DialAddr is for connecting to a peer when you know their addr but not their ID.
146 -// Should only be used when sure that not connected to peer in question
147 -// TODO(jbenet) merge with Dial? need way to patch back.
148 -func (s *Swarm) DialAddr(addr ma.Multiaddr) (*conn.Conn, error) {
149 - if addr == nil {
150 - return nil, errors.New("addr must be a non-nil Multiaddr")
151 - }
152 -
153 - npeer := new(peer.Peer)
154 - npeer.AddAddress(addr)
155 -
156 - c, err := conn.Dial("tcp", s.local, npeer)
157 - if err != nil {
158 - return nil, err
159 - }
160 -
161 - if err := s.connSetup(c); err != nil {
162 - c.Close()
163 - return nil, err
164 - }
165 -
166 - return c, err
167 -}
168 -
144 // GetConnection returns the connection in the swarm to given peer.ID
145 func (s *Swarm) GetConnection(pid peer.ID) *conn.Conn {
146 s.connsLock.RLock()