Apply PR feedback:

handle pubsub dead peer when stream closed in gossipsub
This commit is contained in:
NIC619
2019-11-16 17:03:04 +08:00
parent ccc7879422
commit ace5ef69a8
2 changed files with 8 additions and 5 deletions

View File

@ -440,8 +440,7 @@ class Pubsub:
except StreamClosed:
peer_id = stream.muxed_conn.peer_id
logger.debug("Fail to message peer %s: stream closed", peer_id)
del self.peers[peer_id]
self.router.remove_peer(peer_id)
self._handle_dead_peer(peer_id)
async def publish(self, topic_id: str, data: bytes) -> None:
"""