Commit 71ec4f91 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet Committed by Brian Tiger Chow

Drop -> CloseConnection

parent d934806e
......@@ -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)
}
}
}
......
......@@ -16,5 +16,5 @@ type Network interface {
GetErrChan() chan error
GetChannel(PBWrapper_MessageType) *Chan
Close()
Drop(*peer.Peer) error
CloseConnection(*peer.Peer) error
}
......@@ -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)]
......
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