BTSE: Fix JSONDecode error upon successful websocket connection
BTSE updated their websocket API to send a "connect success" message upon a successful connection
@@ -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 {
