Commit 2563e920 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet Committed by Brian Tiger Chow

network.Find -> network.GetPeer

parent 71ec4f91
......@@ -622,7 +622,7 @@ func (dht *IpfsDHT) addPeerList(key u.Key, peers []*PBDHTMessage_PBPeer) []*peer
continue
}
// Dont add someone who is already on the list
p := dht.network.Find(u.Key(prov.GetId()))
p := dht.network.GetPeer(u.Key(prov.GetId()))
if p == nil {
u.DOut("given provider %s was not in our network already.\n", peer.ID(prov.GetId()).Pretty())
var err error
......
......@@ -8,7 +8,7 @@ import (
)
type Network interface {
Find(u.Key) *peer.Peer
GetPeer(u.Key) *peer.Peer
Listen() error
ConnectNew(*ma.Multiaddr) (*peer.Peer, error)
GetConnection(id peer.ID, addr *ma.Multiaddr) (*peer.Peer, error)
......
......@@ -390,7 +390,8 @@ func (s *Swarm) muxChan(ch *Chan, typ PBWrapper_MessageType) {
}
}
func (s *Swarm) Find(key u.Key) *peer.Peer {
// GetPeer returns the peer in the swarm with given key id.
func (s *Swarm) GetPeer(key u.Key) *peer.Peer {
s.connsLock.RLock()
defer s.connsLock.RUnlock()
conn, found := s.conns[key]
......
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