Fix mypy
This commit is contained in:
parent
04b9d688f8
commit
19ce8a2140
|
@ -611,6 +611,7 @@ class GossipSub(IPubsubRouter):
|
|||
"Fail to responed to iwant request from %s: peer disconnected",
|
||||
sender_peer_id,
|
||||
)
|
||||
return
|
||||
peer_stream = self.pubsub.peers[sender_peer_id]
|
||||
|
||||
# 4) And write the packet to the stream
|
||||
|
@ -719,6 +720,7 @@ class GossipSub(IPubsubRouter):
|
|||
# Get stream for peer from pubsub
|
||||
if to_peer not in self.pubsub.peers:
|
||||
logger.debug("Fail to emit control message to %s: peer disconnected", to_peer)
|
||||
return
|
||||
peer_stream = self.pubsub.peers[to_peer]
|
||||
|
||||
# Write rpc to stream
|
||||
|
|
|
@ -351,7 +351,7 @@ class Pubsub:
|
|||
"""
|
||||
if sub_message.subscribe:
|
||||
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]:
|
||||
# Add peer to topic
|
||||
self.peer_topics[sub_message.topicid].add(origin_id)
|
||||
|
|
Loading…
Reference in New Issue
Block a user