removed blocktime property

This commit is contained in:
cubedro 2015-02-23 16:18:43 +02:00
parent 2b435cec23
commit 00a531fb18
1 changed files with 5 additions and 5 deletions

View File

@ -198,7 +198,6 @@ Node.prototype.getLatestBlocks = function()
this.addBlockHistory(this.stats.block);
this.calculateBlockTimes();
this.stats.blocktimeAvg = this.blockTimesAvg();
this.stats.difficulty = this.difficultyChart();
this.stats.txDensity = this.txDensityChart();
@ -225,19 +224,20 @@ Node.prototype.calculateBlockTimes = function()
{
var diff = (key > 0 ? list[key - 1].timestamp : Math.floor(Date.now()/1000)) - block.timestamp;
self.blocks[key].blocktime = diff;
return diff;
});
blockTimes.shift();
return blockTimes;
}
Node.prototype.blockTimesAvg = function()
{
var sum = _.reduce(this.blocks, function(memo, block) { return memo + block.blocktime;}, 0);
var blockTimes = this.calculateBlockTimes();
var sum = _.reduce(blockTimes, function(memo, time) { return memo + time;}, 0);
return sum/this.blocks.length;
return sum/blockTimes.length;
}
Node.prototype.difficultyChart = function()