do not submit subscribe request if param array is empty

This commit is contained in:
c9s 2020-11-15 13:32:46 +08:00
parent ded970f5a4
commit 3ea2e877ff

View File

@ -155,6 +155,10 @@ func NewStream(client *binance.Client) *Stream {
params = append(params, convertSubscription(subscription))
}
if len(params) == 0 {
return
}
log.Infof("[binance] subscribing channels: %+v", params)
err := stream.Conn.WriteJSON(StreamRequest{
Method: "SUBSCRIBE",