Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasbs17 committed Jan 17, 2024
1 parent a88c95f commit 4997c32
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cryptofeed/exchanges/coinbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ def __reset(self):
self.order_map = {}
self.order_type_map = {}
self.seq_no = None
# sequence number validation only works when the FULL data stream is enabled
chan = self.std_channel_to_exchange(L2_BOOK)
if chan in self.subscription:
pairs = self.subscription[chan]
self.seq_no = {pair: None for pair in pairs}
self._l2_book = {}

async def _ticker(self, msg: dict, timestamp: float):
Expand Down Expand Up @@ -255,4 +260,4 @@ async def _subscribe(chan: str, product_ids: list):
await _subscribe(channel, self.subscription[channel])
all_pairs = list(dict.fromkeys(all_pairs))
await _subscribe('heartbeat', all_pairs)
# Implementing heartbase as per Best Practices doc: https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-best-practices
# Implementing heartbeat as per Best Practices doc: https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-best-practices

0 comments on commit 4997c32

Please sign in to comment.