forked from LBRYCommunity/lbry-sdk
14 lines
348 B
Python
14 lines
348 B
Python
|
from lbrynet.core.Peer import Peer
|
||
|
|
||
|
|
||
|
class PeerManager(object):
|
||
|
def __init__(self):
|
||
|
self.peers = []
|
||
|
|
||
|
def get_peer(self, host, port):
|
||
|
for peer in self.peers:
|
||
|
if peer.host == host and peer.port == port:
|
||
|
return peer
|
||
|
peer = Peer(host, port)
|
||
|
self.peers.append(peer)
|
||
|
return peer
|