mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
Change argument name of Network.listen and blakc format
This commit is contained in:
@ -136,8 +136,11 @@ class KadPeerHeap:
|
||||
def get_uncontacted(self):
|
||||
return [n for n in self if n.peer_id_bytes not in self.contacted]
|
||||
|
||||
|
||||
def create_kad_peerinfo(node_id_bytes=None, sender_ip=None, sender_port=None):
|
||||
node_id = ID(node_id_bytes) if node_id_bytes else ID(digest(random.getrandbits(255)))
|
||||
node_id = (
|
||||
ID(node_id_bytes) if node_id_bytes else ID(digest(random.getrandbits(255)))
|
||||
)
|
||||
peer_data = None
|
||||
if sender_ip and sender_port:
|
||||
peer_data = PeerData() # pylint: disable=no-value-for-parameter
|
||||
|
||||
@ -212,10 +212,10 @@ class KademliaServer:
|
||||
"""
|
||||
log.info("Saving state to %s", fname)
|
||||
data = {
|
||||
'ksize': self.ksize,
|
||||
'alpha': self.alpha,
|
||||
'id': self.node.peer_id_bytes,
|
||||
'neighbors': self.bootstrappable_neighbors()
|
||||
"ksize": self.ksize,
|
||||
"alpha": self.alpha,
|
||||
"id": self.node.peer_id_bytes,
|
||||
"neighbors": self.bootstrappable_neighbors(),
|
||||
}
|
||||
if not data["neighbors"]:
|
||||
log.warning("No known neighbors, so not writing to cache.")
|
||||
|
||||
Reference in New Issue
Block a user