From 4021da7c40cab9578a11ffedd8c4c68a58b8a3e5 Mon Sep 17 00:00:00 2001 From: Chris Heaney Date: Tue, 5 Dec 2023 09:05:50 -0500 Subject: [PATCH] relax slot comparisons --- src/driftpy/accounts/bulk_account_loader.py | 2 +- src/driftpy/accounts/ws/account_subscriber.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/driftpy/accounts/bulk_account_loader.py b/src/driftpy/accounts/bulk_account_loader.py index d607e1ad..83c2ab24 100644 --- a/src/driftpy/accounts/bulk_account_loader.py +++ b/src/driftpy/accounts/bulk_account_loader.py @@ -147,7 +147,7 @@ async def load_chunk(self, chunk: List[List[AccountToLoad]]): pubkey_str = str(account_to_load.pubkey) old_buffer_and_slot = self.buffer_and_slot_map.get(pubkey_str) - if old_buffer_and_slot is not None and slot <= old_buffer_and_slot.slot: + if old_buffer_and_slot is not None and slot < old_buffer_and_slot.slot: continue new_buffer = None diff --git a/src/driftpy/accounts/ws/account_subscriber.py b/src/driftpy/accounts/ws/account_subscriber.py index c2d36f03..676a2e62 100644 --- a/src/driftpy/accounts/ws/account_subscriber.py +++ b/src/driftpy/accounts/ws/account_subscriber.py @@ -86,7 +86,7 @@ def _update_data(self, new_data: Optional[DataAndSlot[T]]): if new_data is None: return - if self.data_and_slot is None or new_data.slot > self.data_and_slot.slot: + if self.data_and_slot is None or new_data.slot >= self.data_and_slot.slot: self.data_and_slot = new_data def unsubscribe(self):