mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Prevent self re-subscription
This commit is contained in:
@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user