Skip to content

Commit

Permalink
binance: avoid using fromId and timeRange at the same time
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Dec 9, 2022
1 parent 99f72cf commit dac1cd0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions pkg/exchange/binance/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -1506,19 +1506,19 @@ func (e *Exchange) querySpotTrades(ctx context.Context, symbol string, options *
// BINANCE uses inclusive last trade ID
if options.LastTradeID > 0 {
req.FromID(options.LastTradeID)
}

if options.StartTime != nil && options.EndTime != nil {
if options.EndTime.Sub(*options.StartTime) < 24*time.Hour {
} else {
if options.StartTime != nil && options.EndTime != nil {
if options.EndTime.Sub(*options.StartTime) < 24*time.Hour {
req.StartTime(*options.StartTime)
req.EndTime(*options.EndTime)
} else {
req.StartTime(*options.StartTime)
}
} else if options.StartTime != nil {
req.StartTime(*options.StartTime)
} else if options.EndTime != nil {
req.EndTime(*options.EndTime)
} else {
req.StartTime(*options.StartTime)
}
} else if options.StartTime != nil {
req.StartTime(*options.StartTime)
} else if options.EndTime != nil {
req.EndTime(*options.EndTime)
}

if options.Limit > 0 {
Expand Down

0 comments on commit dac1cd0

Please sign in to comment.