Bittrex: Enable ws orderbook sync recovery (resolves #746) (#747)

* [FIX] Enable ws orderbook sync recovery by:

- Testing if books have been cleared
- Assigning options when loading snapshot

* orderbooks: remove setlastupdate method and on select depth method that updates linked list, this reduced lock contention across code base and fixes buffer bug on applying buffered updates

* WS - Introduce signaling for the need to fetch the orderbook

* Address nits

* Update error messages to include exchange name

Co-authored-by: shazbert <oharareid.ryan@gmail.com>
This commit is contained in:
TaltaM
2021-08-18 03:43:46 +02:00
committed by GitHub
parent 08df015a57
commit 4ba2c710b5
7 changed files with 166 additions and 94 deletions

View File

@@ -802,7 +802,7 @@ func TestUpdateByIDAndAction(t *testing.T) {
t.Fatal(err)
}
book.LoadSnapshot(append(bids[:0:0], bids...), append(asks[:0:0], asks...))
book.LoadSnapshot(append(bids[:0:0], bids...), append(asks[:0:0], asks...), 0, time.Time{}, true)
err = book.Retrieve().Verify()
if err != nil {
@@ -924,7 +924,7 @@ func TestUpdateByIDAndAction(t *testing.T) {
t.Fatal("did not adjust ask item placement and details")
}
book.LoadSnapshot(append(bids[:0:0], bids...), append(bids[:0:0], bids...)) // nolint:gocritic
book.LoadSnapshot(append(bids[:0:0], bids...), append(bids[:0:0], bids...), 0, time.Time{}, true) // nolint:gocritic
// Delete - not found
err = holder.updateByIDAndAction(&Update{