fix: do not share the subscriptions object between relays

Change in one relay reflects in others.
The RelayManager takes care of updating each relay individually.
This commit is contained in:
Vlad Stan 2023-05-31 11:55:41 +03:00
parent 629aa3a6c3
commit 6852a9aa5e

View file

@ -23,7 +23,7 @@ class RelayManager:
self, url: str, read: bool = True, write: bool = True, subscriptions={}
):
policy = RelayPolicy(read, write)
relay = Relay(url, policy, self.message_pool, subscriptions)
relay = Relay(url, policy, self.message_pool, subscriptions.copy())
self.relays[url] = relay
def remove_relay(self, url: str):