Merge branch 'develop' of https://github.com/cubedro/eth-netstats into develop

Merge with develop
This commit is contained in:
cubedro
2015-08-07 16:18:02 +03:00
5 changed files with 99 additions and 62 deletions

View File

@@ -436,6 +436,25 @@ History.prototype.getBlockTimes = function()
return blockTimes;
}
History.prototype.getGasLimit = function()
{
var gasLimitHistory = _( this._items )
.sortByOrder( 'height', false )
// .filter(function (item)
// {
// return item.block.trusted;
// })
.slice(0, MAX_BINS)
.reverse()
.map(function (item)
{
return item.block.gasLimit;
})
.value();
return gasLimitHistory;
}
History.prototype.getDifficulty = function()
{
var difficultyHistory = _( this._items )
@@ -540,7 +559,7 @@ History.prototype.getMinersCount = function()
return _(minerCount)
.sortByOrder( 'blocks', false )
.slice(0, 5)
.slice(0, 2)
.value();
}
@@ -570,6 +589,7 @@ History.prototype.getCharts = function()
uncles: item.block.uncles.length,
transactions: item.block.transactions.length,
gasSpending: item.block.gasUsed,
gasLimit: item.block.gasLimit,
miner: item.block.miner
};
})
@@ -583,6 +603,7 @@ History.prototype.getCharts = function()
uncles : _.pluck( chartHistory, 'uncles' ),
transactions : _.pluck( chartHistory, 'transactions' ),
gasSpending : _.pluck( chartHistory, 'gasSpending' ),
gasLimit : _.pluck( chartHistory, 'gasLimit' ),
miners : this.getMinersCount(),
propagation : this.getBlockPropagation(),
uncleCount : this.getUncleCount(),