diff --git a/routing/dht/dht.go b/routing/dht/dht.go index 83962e210..f8e5e0202 100644 --- a/routing/dht/dht.go +++ b/routing/dht/dht.go @@ -521,7 +521,7 @@ func (dht *IpfsDHT) putLocal(key u.Key, value []byte) error { func (dht *IpfsDHT) Update(p *peer.Peer) { for _, route := range dht.routingTables { removed := route.Update(p) - // Only drop the connection if no tables refer to this peer + // Only close the connection if no tables refer to this peer if removed != nil { found := false for _, r := range dht.routingTables { @@ -531,7 +531,7 @@ func (dht *IpfsDHT) Update(p *peer.Peer) { } } if !found { - dht.network.Drop(removed) + dht.network.CloseConnection(removed) } } } diff --git a/swarm/interface.go b/swarm/interface.go index 413a42ee2..a1c7abf11 100644 --- a/swarm/interface.go +++ b/swarm/interface.go @@ -16,5 +16,5 @@ type Network interface { GetErrChan() chan error GetChannel(PBWrapper_MessageType) *Chan Close() - Drop(*peer.Peer) error + CloseConnection(*peer.Peer) error } diff --git a/swarm/swarm.go b/swarm/swarm.go index 04b887526..eecb3518d 100644 --- a/swarm/swarm.go +++ b/swarm/swarm.go @@ -467,8 +467,8 @@ func (s *Swarm) ConnectNew(addr *ma.Multiaddr) (*peer.Peer, error) { return npeer, err } -// Removes a given peer from the swarm and closes connections to it -func (s *Swarm) Drop(p *peer.Peer) error { +// CloseConnection removes a given peer from swarm + closes the connection +func (s *Swarm) CloseConnection(p *peer.Peer) error { u.DOut("Dropping peer: [%s]\n", p.ID.Pretty()) s.connsLock.RLock() conn, found := s.conns[u.Key(p.ID)]