This commit is contained in:
NIC619 2019-12-17 21:56:02 +08:00
parent 04b9d688f8
commit 19ce8a2140
No known key found for this signature in database
GPG Key ID: 570C35F5C2D51B17
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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)