From 8693bbbd2433ba6279bab388371ab0a3f80e0538 Mon Sep 17 00:00:00 2001 From: c9s Date: Thu, 5 Nov 2020 11:08:04 +0800 Subject: [PATCH] fix orderId-based query for binance --- pkg/types/exchange.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/types/exchange.go b/pkg/types/exchange.go index eb08f79eb..6fd5527e0 100644 --- a/pkg/types/exchange.go +++ b/pkg/types/exchange.go @@ -91,7 +91,7 @@ func (e ExchangeBatchProcessor) BatchQueryClosedOrders(ctx context.Context, symb return } - if len(orders) == 0 { + if len(orders) == 0 || (len(orders) == 1 && orders[0].OrderID == lastOrderID) { startTime = limitedEndTime continue } @@ -105,6 +105,7 @@ func (e ExchangeBatchProcessor) BatchQueryClosedOrders(ctx context.Context, symb c <- o startTime = o.CreationTime lastOrderID = o.OrderID + orderIDs[o.OrderID] = struct{}{} } }