Skip to content

Commit

Permalink
deribit: fix subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
shazbert committed Jan 15, 2025
1 parent 457cba1 commit dc72434
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion exchanges/deribit/deribit_websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -1176,9 +1176,14 @@ func (d *Deribit) handleSubscription(operation string, channels subscription.Lis
return fmt.Errorf("%v %v", d.Name, err)
}
if payloads[x].ID == response.ID && len(response.Result) == 0 {
log.Errorf(log.ExchangeSys, "subscription to channel %s was not successful", payloads[x].Params["channels"][0])
return fmt.Errorf("subscription to channel %s was not successful", payloads[x].Params["channels"][0])
}
}
if operation == "unsubscribe" {
d.Websocket.RemoveSubscriptions(d.Websocket.Conn, channels...)
} else {
d.Websocket.AddSubscriptions(d.Websocket.Conn, channels...)
}
return nil
}

Expand Down

0 comments on commit dc72434

Please sign in to comment.