added blocktime average to history

This commit is contained in:
cubedro
2015-04-28 12:31:49 +03:00
parent e9618aac5c
commit 4f7ba9f578
2 changed files with 2 additions and 4 deletions

View File

@@ -295,6 +295,7 @@ History.prototype.getCharts = function()
var chart = {
height: _.pluck(chartHistory, 'height'),
blocktime: _.pluck(chartHistory, 'blocktime'),
avgBlocktime: _.sum(_.pluck(chartHistory, 'blocktime')) / (chartHistory.length === 0 ? 1 : chartHistory.length),
difficulty: _.pluck(chartHistory, 'difficulty'),
uncles: _.pluck(chartHistory, 'uncles'),
transactions: _.pluck(chartHistory, 'transactions'),