Skip to content

Commit

Permalink
Bitfinex: Error it ws data id/cid is not a float64
Browse files Browse the repository at this point in the history
  • Loading branch information
gbjk committed Aug 11, 2023
1 parent 83c6ea7 commit 5c1398e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions exchanges/bitfinex/bitfinex_websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,9 @@ func (b *Bitfinex) wsHandleData(respRaw []byte) error {
}
case strings.Contains(channelName, wsOrderNewRequest):
if data[2] != nil {
if cid, ok := data[2].(float64); ok && cid > 0 {
if cid, ok := data[2].(float64); !ok {
return common.GetTypeAssertError("float64", data[2])
} else if cid > 0 {
if b.Websocket.Match.IncomingWithData(int64(cid), respRaw) {
return nil
}
Expand All @@ -670,7 +672,9 @@ func (b *Bitfinex) wsHandleData(respRaw []byte) error {
case strings.Contains(channelName, wsOrderUpdateRequest),
strings.Contains(channelName, wsOrderCancelRequest):
if data[0] != nil {
if id, ok := data[0].(float64); ok && id > 0 {
if id, ok := data[0].(float64); !ok {
return common.GetTypeAssertError("float64", data[0])
} else if id > 0 {
if b.Websocket.Match.IncomingWithData(int64(id), respRaw) {
return nil
}
Expand Down

0 comments on commit 5c1398e

Please sign in to comment.