Fix bug in method BfxWebSocketBucket::unsubscribe.

This commit is contained in:
Davide Casale
2023-07-28 16:41:52 +02:00
parent ce23a8991a
commit 26f25e5848

View File

@@ -113,12 +113,11 @@ class BfxWebSocketBucket(Connection):
@Connection.require_websocket_connection
async def unsubscribe(self, sub_id: str) -> None:
for subscription in self.__subscriptions.values():
for chan_id, subscription in self.__subscriptions.items():
if subscription["subId"] == sub_id:
data = { "event": "unsubscribe", \
"chanId": subscription["subId"] }
message = json.dumps(data)
message = json.dumps({
"event": "unsubscribe",
"chanId": chan_id })
await self._websocket.send(message)