mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-14 07:26:47 +00:00
Kraken: wsProcessOrderBook, the method was returning wrong bids data (#551)
* Kraken - wsProcessOrderBook, the method was returning wrong bids data * additional map check to prevent panic * linter issue fix Co-authored-by: Vazha Bezhanishvili <vazha.bezhanishvili@elegro.eu>
This commit is contained in:
@@ -605,9 +605,10 @@ func (k *Kraken) wsProcessTrades(channelData *WebsocketChannelData, data []inter
|
||||
// wsProcessOrderBook determines if the orderbook data is partial or update
|
||||
// Then sends to appropriate fun
|
||||
func (k *Kraken) wsProcessOrderBook(channelData *WebsocketChannelData, data map[string]interface{}) error {
|
||||
if fullAsk, ok := data["as"].([]interface{}); ok {
|
||||
fullBids := data["as"].([]interface{})
|
||||
err := k.wsProcessOrderBookPartial(channelData, fullAsk, fullBids)
|
||||
askSnapshot, askSnapshotExists := data["as"].([]interface{})
|
||||
bidSnapshot, bidSnapshotExists := data["bs"].([]interface{})
|
||||
if askSnapshotExists || bidSnapshotExists {
|
||||
err := k.wsProcessOrderBookPartial(channelData, askSnapshot, bidSnapshot)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
BIN
go_build_github_com_thrasher_corp_gocryptotrader
Executable file
BIN
go_build_github_com_thrasher_corp_gocryptotrader
Executable file
Binary file not shown.
Reference in New Issue
Block a user