Commit e1344c84 by ken

depth

parent b5c0716e
...@@ -180,7 +180,7 @@ function depthByRest(symbol,callback) { ...@@ -180,7 +180,7 @@ function depthByRest(symbol,callback) {
const key = symbol.replace('_', '').toUpperCase() + 'DEPTH@zb'; const key = symbol.replace('_', '').toUpperCase() + 'DEPTH@zb';
symbol = symbol.toUpperCase(); symbol = symbol.toUpperCase();
const lastEventTime = lastEventTimeMap[symbol] || 0; const lastEventTime = lastEventTimeMap[symbol] || 0;
if (data.timestamp > lastEventTime || (data.timestamp === lastEventTime && JSON.stringify(data) != JSON.stringify(lastDataMap[symbol]))) { if (data.timestamp > lastEventTime || (data.timestamp === lastEventTime && JSON.stringify(data) !== JSON.stringify(lastDataMap[symbol]))) {
lastEventTimeMap[symbol] = data.timestamp; lastEventTimeMap[symbol] = data.timestamp;
lastDataMap[symbol] = data; lastDataMap[symbol] = data;
if (symbol === "BTCUSDT") { if (symbol === "BTCUSDT") {
......
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