forked from LBRYCommunity/lbry-sdk
add method for getting the node_id from a known peer on peer manager
This commit is contained in:
parent
a334a93757
commit
be06378437
1 changed files with 3 additions and 0 deletions
|
@ -100,6 +100,9 @@ class PeerManager:
|
|||
self._node_id_reverse_mapping[node_id] = (address, udp_port)
|
||||
self.peer_manager_keys_metric.labels("global").set(self.count_cache_keys())
|
||||
|
||||
def get_node_id_for_endpoint(self, address, port):
|
||||
return self._node_id_mapping.get((address, port))
|
||||
|
||||
def prune(self): # TODO: periodically call this
|
||||
now = self._loop.time()
|
||||
to_pop = []
|
||||
|
|
Loading…
Reference in a new issue