Remove dead peer if floodsub write stream fail

This commit is contained in:
NIC619 2019-12-17 18:48:25 +08:00
parent 009df257bc
commit 474ed41652
No known key found for this signature in database
GPG Key ID: 570C35F5C2D51B17

View File

@ -98,6 +98,7 @@ class FloodSub(IPubsubRouter):
await stream.write(encode_varint_prefixed(rpc_msg.SerializeToString()))
except StreamClosed:
logger.debug("Fail to publish message to %s: stream closed", peer_id)
self.pubsub._handle_dead_peer(peer_id)
async def join(self, topic: str) -> None:
"""