From ce23a8991a0fe38982361efd1ee4f5b673181be5 Mon Sep 17 00:00:00 2001 From: Davide Casale Date: Fri, 28 Jul 2023 15:19:44 +0200 Subject: [PATCH] Block negative checksums for possible race condition (PublicChannelsHandler::__checksum_handler). --- bfxapi/websocket/_handlers/public_channels_handler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bfxapi/websocket/_handlers/public_channels_handler.py b/bfxapi/websocket/_handlers/public_channels_handler.py index bfc7208..fa9b838 100644 --- a/bfxapi/websocket/_handlers/public_channels_handler.py +++ b/bfxapi/websocket/_handlers/public_channels_handler.py @@ -150,4 +150,6 @@ class PublicChannelsHandler: serializers.Liquidation.parse(*stream[0][0])) def __checksum_handler(self, subscription: "Book", value: int): - return self.__event_emitter.emit("checksum", subscription, value) + if not value < 0: + return self.__event_emitter.emit( \ + "checksum", subscription, value)