BTSE: Fix JSONDecode error upon successful websocket connection

BTSE updated their websocket API to send a "connect success" message upon a successful connection
This commit is contained in:
Adrian Gallagher
2019-04-15 14:53:38 +10:00
parent 5a42a4162b
commit 388d160f2b

View File

@@ -14,6 +14,7 @@ import (
"github.com/thrasher-/gocryptotrader/currency"
exchange "github.com/thrasher-/gocryptotrader/exchanges"
"github.com/thrasher-/gocryptotrader/exchanges/orderbook"
log "github.com/thrasher-/gocryptotrader/logger"
)
const (
@@ -122,6 +123,14 @@ func (b *BTSE) WsHandleData() {
ProductID string `json:"product_id"`
}
if strings.Contains(string(resp.Raw), "connect success") {
if b.Verbose {
log.Debugf("%s websocket client successfully connected to %s",
b.Name, b.Websocket.GetWebsocketURL())
}
continue
}
msgType := MsgType{}
err = common.JSONDecode(resp.Raw, &msgType)
if err != nil {