diff --git a/libp2p/pubsub/pubsub.py b/libp2p/pubsub/pubsub.py index 3e8f74c..07008ca 100644 --- a/libp2p/pubsub/pubsub.py +++ b/libp2p/pubsub/pubsub.py @@ -209,6 +209,10 @@ class Pubsub(): :param topic_id: topic_id to subscribe to """ + # Already subscribed + if topic_id in self.my_topics: + return self.my_topics[topic_id] + # Map topic_id to blocking queue self.my_topics[topic_id] = asyncio.Queue()