From 474ed41652fc7a5f3439cec4d35ced98d14fa5b8 Mon Sep 17 00:00:00 2001 From: NIC619 Date: Tue, 17 Dec 2019 18:48:25 +0800 Subject: [PATCH] Remove dead peer if floodsub write stream fail --- libp2p/pubsub/floodsub.py | 1 + 1 file changed, 1 insertion(+) diff --git a/libp2p/pubsub/floodsub.py b/libp2p/pubsub/floodsub.py index b7b7910..bae2bf2 100644 --- a/libp2p/pubsub/floodsub.py +++ b/libp2p/pubsub/floodsub.py @@ -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: """