forked from LBRYCommunity/lbry-sdk
add Node.contacts helper property
This commit is contained in:
parent
23ce278f8a
commit
5937ead17c
1 changed files with 8 additions and 0 deletions
|
@ -171,6 +171,14 @@ class Node(object):
|
||||||
self.hash_watcher.tick()
|
self.hash_watcher.tick()
|
||||||
yield self._joinDeferred
|
yield self._joinDeferred
|
||||||
|
|
||||||
|
@property
|
||||||
|
def contacts(self):
|
||||||
|
def _inner():
|
||||||
|
for i in range(len(self._routingTable._buckets)):
|
||||||
|
for contact in self._routingTable._buckets[i]._contacts:
|
||||||
|
yield contact
|
||||||
|
return list(_inner())
|
||||||
|
|
||||||
def printContacts(self, *args):
|
def printContacts(self, *args):
|
||||||
print '\n\nNODE CONTACTS\n==============='
|
print '\n\nNODE CONTACTS\n==============='
|
||||||
for i in range(len(self._routingTable._buckets)):
|
for i in range(len(self._routingTable._buckets)):
|
||||||
|
|
Loading…
Add table
Reference in a new issue