Commit 8bc20132 by ken

depth

parent 341fff60
......@@ -181,10 +181,13 @@ function depthByRest(symbol,callback) {
symbol = symbol.toUpperCase();
const lastEventTime = lastEventTimeMap[symbol] || 0;
if (data.timestamp > lastEventTime || (data.timestamp === lastEventTime && JSON.stringify(data) !== lastDataMap[symbol])) {
if (symbol === "BTCUSDT" && data.timestamp === lastEventTime) {
console.log(symbol + '@' + data.timestamp * 1000 + ' from rest');
console.log(lastDataMap[symbol]);
console.log(JSON.stringify(data));
if (symbol === "BTCUSDT") {
let consoleMethod = console.log;
if (data.timestamp === lastEventTime) {
consoleMethod = console.error
}
consoleMethod(symbol + '@' + data.timestamp * 1000 + ' from rest');
consoleMethod(JSON.stringify(data));
}
lastEventTimeMap[symbol] = data.timestamp;
lastDataMap[symbol] = JSON.stringify(data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment