From f9849eae31fd15a52ecee8b560580cbc2da45f33 Mon Sep 17 00:00:00 2001 From: Ermal Guni Date: Sun, 5 Aug 2018 15:14:08 +0200 Subject: [PATCH] added gorilla websocket conn and mutex --- exchanges/okex/okex.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exchanges/okex/okex.go b/exchanges/okex/okex.go index f7cd944f..56b927ce 100644 --- a/exchanges/okex/okex.go +++ b/exchanges/okex/okex.go @@ -8,8 +8,10 @@ import ( "reflect" "strconv" "strings" + "sync" "time" + "github.com/gorilla/websocket" "github.com/thrasher-/gocryptotrader/common" "github.com/thrasher-/gocryptotrader/config" exchange "github.com/thrasher-/gocryptotrader/exchanges" @@ -78,6 +80,8 @@ var errMissValue = errors.New("warning - resp value is missing from exchange") // OKEX is the overaching type across the OKEX methods type OKEX struct { exchange.Base + WebsocketConn *websocket.Conn + mu sync.Mutex // Spot and contract market error codes as per https://www.okex.com/rest_request.html ErrorCodes map[string]error