mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-08 15:11:07 +00:00
General fixes for CancelAllOrders exchange wrapper function (#313)
* General fixes for CancelAllOrders * Fix error shadowing issue * Initialise order status map and rm reduntant initialisations
This commit is contained in:
committed by
Adrian Gallagher
parent
416fbbd5ae
commit
a80acb16de
@@ -264,13 +264,15 @@ func (o *OKGroup) CancelOrder(orderCancellation *exchange.OrderCancellation) (er
|
||||
}
|
||||
|
||||
// CancelAllOrders cancels all orders associated with a currency pair
|
||||
func (o *OKGroup) CancelAllOrders(orderCancellation *exchange.OrderCancellation) (resp exchange.CancelAllOrdersResponse, _ error) {
|
||||
func (o *OKGroup) CancelAllOrders(orderCancellation *exchange.OrderCancellation) (resp exchange.CancelAllOrdersResponse, err error) {
|
||||
orderIDs := strings.Split(orderCancellation.OrderID, ",")
|
||||
resp.OrderStatus = make(map[string]string)
|
||||
var orderIDNumbers []int64
|
||||
for _, i := range orderIDs {
|
||||
orderIDNumber, err := strconv.ParseInt(i, 10, 64)
|
||||
if err != nil {
|
||||
return resp, err
|
||||
orderIDNumber, strConvErr := strconv.ParseInt(i, 10, 64)
|
||||
if strConvErr != nil {
|
||||
resp.OrderStatus[i] = strConvErr.Error()
|
||||
continue
|
||||
}
|
||||
orderIDNumbers = append(orderIDNumbers, orderIDNumber)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user