mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Fix mypy
This commit is contained in:
@ -611,6 +611,7 @@ class GossipSub(IPubsubRouter):
|
|||||||
"Fail to responed to iwant request from %s: peer disconnected",
|
"Fail to responed to iwant request from %s: peer disconnected",
|
||||||
sender_peer_id,
|
sender_peer_id,
|
||||||
)
|
)
|
||||||
|
return
|
||||||
peer_stream = self.pubsub.peers[sender_peer_id]
|
peer_stream = self.pubsub.peers[sender_peer_id]
|
||||||
|
|
||||||
# 4) And write the packet to the stream
|
# 4) And write the packet to the stream
|
||||||
@ -719,6 +720,7 @@ class GossipSub(IPubsubRouter):
|
|||||||
# Get stream for peer from pubsub
|
# Get stream for peer from pubsub
|
||||||
if to_peer not in self.pubsub.peers:
|
if to_peer not in self.pubsub.peers:
|
||||||
logger.debug("Fail to emit control message to %s: peer disconnected", to_peer)
|
logger.debug("Fail to emit control message to %s: peer disconnected", to_peer)
|
||||||
|
return
|
||||||
peer_stream = self.pubsub.peers[to_peer]
|
peer_stream = self.pubsub.peers[to_peer]
|
||||||
|
|
||||||
# Write rpc to stream
|
# Write rpc to stream
|
||||||
|
|||||||
@ -351,7 +351,7 @@ class Pubsub:
|
|||||||
"""
|
"""
|
||||||
if sub_message.subscribe:
|
if sub_message.subscribe:
|
||||||
if sub_message.topicid not in self.peer_topics:
|
if sub_message.topicid not in self.peer_topics:
|
||||||
self.peer_topics[sub_message.topicid] = [origin_id]
|
self.peer_topics[sub_message.topicid] = set([origin_id])
|
||||||
elif origin_id not in self.peer_topics[sub_message.topicid]:
|
elif origin_id not in self.peer_topics[sub_message.topicid]:
|
||||||
# Add peer to topic
|
# Add peer to topic
|
||||||
self.peer_topics[sub_message.topicid].add(origin_id)
|
self.peer_topics[sub_message.topicid].add(origin_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user