From a81bee9502bcf7743ccf0d0c84325ca2b295ed17 Mon Sep 17 00:00:00 2001 From: cubedro Date: Mon, 6 Apr 2015 02:26:43 +0300 Subject: [PATCH] added miner result limit --- lib/node.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/node.js b/lib/node.js index c3ca9fa..1ca91ec 100644 --- a/lib/node.js +++ b/lib/node.js @@ -36,6 +36,7 @@ var PENDING_WORKS = true; var MAX_BLOCKS_HISTORY = 36; var UPDATE_INTERVAL = 5000; var PING_INTERVAL = 2000; +var MINERS_LIMIT = 5; function Node() { @@ -312,7 +313,9 @@ Node.prototype.minersChart = function() minersArray.push({miner: miner, blocks: cnt}); }); - return _.sortBy(minersArray, 'blocks').reverse(); + var minersArray = _.sortBy(minersArray, 'blocks').reverse(); + + return minersArray.slice(0, MINERS_LIMIT); } Node.prototype.uptime = function()