From 30c8c510e2c7acd43f0e57fbcf5fa85fc074346e Mon Sep 17 00:00:00 2001 From: cubedro Date: Tue, 28 Apr 2015 04:02:12 +0300 Subject: [PATCH 1/2] fixed transaction count --- models/history.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/models/history.js b/models/history.js index 38ae779..213959a 100644 --- a/models/history.js +++ b/models/history.js @@ -188,7 +188,7 @@ History.prototype.getUncleCount = function(id) History.prototype.getTransactionsCount = function(id) { - var uncles = _(this._items) + var txCount = _(this._items) .sortByOrder('height', false) .slice(0, MAX_BINS - 1) .reverse() @@ -198,16 +198,7 @@ History.prototype.getTransactionsCount = function(id) }) .value(); - var uncleBins = _.fill(Array(MAX_BINS), 0); - - var sumMapper = function(array, key) { - uncleBins[key] = _.sum(array); - return _.sum(array); - }; - - _.map(_.chunk(uncles, MAX_UNCLES_PER_BIN), sumMapper); - - return uncleBins; + return txCount; } History.prototype.history = function() From c9dde35e09589bce6dcda436bd7b50a183b2179c Mon Sep 17 00:00:00 2001 From: cubedro Date: Tue, 28 Apr 2015 04:03:20 +0300 Subject: [PATCH 2/2] removed more console.logs --- app.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/app.js b/app.js index f4eb12d..8d76f54 100644 --- a/app.js +++ b/app.js @@ -74,9 +74,6 @@ api.on('connection', function(spark) { spark.on('update', function(data) { - console.log('Latency: ', spark.latency); - console.log('Got update from ' + spark.id); - if(typeof data.id !== 'undefined' && typeof data.stats !== 'undefined') { data.stats.latency = spark.latency; @@ -118,10 +115,6 @@ api.on('connection', function(spark) { }); client.on('connection', function(spark) { - console.log(spark.id); - console.log(spark.address); - console.log(spark.query); - spark.on('ready', function(data){ spark.emit('init', {nodes: Nodes.all()});