Skip to content

Commit

Permalink
Merge pull request #1 from anewhuahua/fix_depth_websocket
Browse files Browse the repository at this point in the history
fix_depth_websocket_missing_ask_data
  • Loading branch information
BWMuller authored Jan 29, 2018
2 parents 5de9cb3 + 0405ac9 commit a81913c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions service_websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,22 @@ func (as *apiService) DepthWebsocket(dwr DepthWebsocketRequest) (chan *DepthEven
Quantity: q,
})
}
for _, a := range rawDepth.AskDepthDelta {
p, err := floatFromString(a[0])
if err != nil {
level.Error(as.Logger).Log("wsUnmarshal", err, "body", string(message))
return
}
q, err := floatFromString(a[1])
if err != nil {
level.Error(as.Logger).Log("wsUnmarshal", err, "body", string(message))
return
}
de.Asks = append(de.Asks, &Order{
Price: p,
Quantity: q,
})
}
dech <- de
}
}
Expand Down

0 comments on commit a81913c

Please sign in to comment.