lbry-sdk/lbrynet/p2p/PeerManager.py
2018-11-04 20:25:24 -05:00

14 lines
340 B
Python

from lbrynet.p2p.Peer import Peer
class PeerManager:
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