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:
Ryan O'Hara-Reid
2019-05-31 16:06:10 +10:00
committed by Adrian Gallagher
parent 416fbbd5ae
commit a80acb16de
19 changed files with 54 additions and 50 deletions

View File

@@ -239,7 +239,6 @@ func (z *ZB) CancelAllOrders(_ *exchange.OrderCancellation) (exchange.CancelAllO
}
var allOpenOrders []Order
for _, currency := range z.GetEnabledCurrencies() {
var pageNumber int64
// Limiting to 10 pages
for i := 0; i < 10; i++ {
openOrders, err := z.GetUnfinishedOrdersIgnoreTradeType(exchange.FormatExchangeCurrency(z.Name, currency).String(), 1, 10)
@@ -252,7 +251,6 @@ func (z *ZB) CancelAllOrders(_ *exchange.OrderCancellation) (exchange.CancelAllO
}
allOpenOrders = append(allOpenOrders, openOrders...)
pageNumber++
}
}