Skip to content

Commit

Permalink
Minor clarification about OrderBook seq number
Browse files Browse the repository at this point in the history
  • Loading branch information
norwnd committed Mar 8, 2023
1 parent 45cc271 commit 6bfa596
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/orderbook/orderbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ func (ob *OrderBook) setSeq(seq uint64) {
ob.seqMtx.Lock()
defer ob.seqMtx.Unlock()
if seq != ob.seq+1 {
// Logging as error to make it visible for debugging purposes, but it's not
// error actually because we might receive notification from previous
// subscription, previous - meaning it will have seq number less than
// seq in order snapshot we got when resubscribing.
ob.log.Errorf("notification received out of sync. %d != %d - 1", ob.seq, seq)
}
if seq > ob.seq {
Expand Down

0 comments on commit 6bfa596

Please sign in to comment.