mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-06 07:26:47 +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
@@ -266,15 +266,15 @@ func (g *Gateio) CancelAllOrders(_ *exchange.OrderCancellation) (exchange.Cancel
|
||||
return cancelAllOrdersResponse, err
|
||||
}
|
||||
|
||||
uniqueSymbols := make(map[string]string)
|
||||
uniqueSymbols := make(map[string]int)
|
||||
for i := range openOrders.Orders {
|
||||
uniqueSymbols[openOrders.Orders[i].CurrencyPair] = openOrders.Orders[i].CurrencyPair
|
||||
uniqueSymbols[openOrders.Orders[i].CurrencyPair]++
|
||||
}
|
||||
|
||||
for unique := range uniqueSymbols {
|
||||
err = g.CancelAllExistingOrders(-1, uniqueSymbols[unique])
|
||||
err = g.CancelAllExistingOrders(-1, unique)
|
||||
if err != nil {
|
||||
return cancelAllOrdersResponse, err
|
||||
cancelAllOrdersResponse.OrderStatus[unique] = err.Error()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user