Merge pull request #259 from jnlin/fix/ftx-kline

fix(ftx): klines should not be empty
This commit is contained in:
Yo-An Lin 2021-05-31 23:12:50 +08:00 committed by GitHub
commit d6fc89d18a

View File

@ -139,7 +139,7 @@ func (s *Stream) pollKLines(ctx context.Context) {
for _, sub := range s.klineSubscriptions {
klines := getLastKLine(s.exchange, ctx, sub.symbol, sub.interval)
if len(klines) >= 0 {
if len(klines) > 0 {
// handle mutiple klines, get the latest one
s.EmitKLineClosed(klines[len(klines)-1])
}