From 415ec3832ed07366b87fdccfe444ebd31567fb0f Mon Sep 17 00:00:00 2001 From: mutalisk999 Date: Sat, 27 Nov 2021 14:21:22 +0800 Subject: [PATCH] syntax issues fixed by IDE --- lib/api.js | 60 ++++++++++++++++++++++---------------------- lib/apiInterfaces.js | 2 +- lib/blockUnlocker.js | 3 +-- lib/pool.js | 14 +++++------ 4 files changed, 39 insertions(+), 40 deletions(-) diff --git a/lib/api.js b/lib/api.js index ebdeb75..3ef77bc 100644 --- a/lib/api.js +++ b/lib/api.js @@ -12,7 +12,7 @@ var charts = require('./charts.js'); var authSid = Math.round(Math.random() * 10000000000) + '' + Math.round(Math.random() * 10000000000); var logSystem = 'api'; -var emailSystem = require('./email.js'); +// var emailSystem = require('./email.js'); require('./exceptionWriter.js')(logSystem); var redisCommands = [ @@ -86,7 +86,7 @@ function collectStats(){ var shares = minersHashrate[miner]; // Do not count the hashrates of individual workers. Instead // only use the shares where miner == wallet address. - if (miner.indexOf('+') != -1) { + if (miner.indexOf('+') !== -1) { totalShares += shares; } minersHashrate[miner] = Math.round(shares / config.api.hashrateWindow); @@ -100,8 +100,8 @@ function collectStats(){ data.roundHashes = 0; if (replies[5]){ - for (var miner in replies[5]){ - data.roundHashes += parseInt(replies[5][miner]); + for (var reply in replies[5]){ + data.roundHashes += parseInt(replies[5][reply]); } } @@ -268,7 +268,7 @@ function handleMinerStats(urlParts, response){ for (var i=0; i