fix: debug code

This commit is contained in:
zenix 2022-08-31 13:01:00 +09:00
parent b52598d1ad
commit a28b257568

View File

@ -377,14 +377,13 @@ func (e *Exchange) ConsumeKLine(k types.KLine) {
kline1m, ok := matching.klineCache[k.Interval] kline1m, ok := matching.klineCache[k.Interval]
if ok { // pop out all the old if ok { // pop out all the old
if kline1m.Interval != types.Interval1m { if kline1m.Interval != types.Interval1m {
panic("expect 1m kline, get " + kline1m.Interval.String()) panic("expect 1m kline, got " + kline1m.Interval.String())
} }
e.currentTime = kline1m.EndTime.Time() e.currentTime = kline1m.EndTime.Time()
// here we generate trades and order updates // here we generate trades and order updates
matching.processKLine(kline1m) matching.processKLine(kline1m)
matching.NextKLine = &k matching.NextKLine = &k
for _, kline := range matching.klineCache { for _, kline := range matching.klineCache {
// log.Errorf("kline %v, next %v", param.kline, matching.NextKLine)
e.MarketDataStream.EmitKLineClosed(kline) e.MarketDataStream.EmitKLineClosed(kline)
for _, h := range e.Src.Callbacks { for _, h := range e.Src.Callbacks {
h(kline, e.Src) h(kline, e.Src)