diff --git a/models/history.js b/models/history.js index 26fa9ed..cbe8f96 100644 --- a/models/history.js +++ b/models/history.js @@ -336,7 +336,7 @@ History.prototype.getAvgHashrate = function() var avgBlocktime = (_.sum(blocktimeHistory) / blocktimeHistory.length)/1000; - return avgDifficulty * 12 * ( 12 / avgBlocktime ); + return this.bestBlock().block.difficulty / 12 * ( 12 / avgBlocktime ); } History.prototype.getMinersCount = function() diff --git a/public/js/controllers.js b/public/js/controllers.js index e0d4f48..bf48fdf 100644 --- a/public/js/controllers.js +++ b/public/js/controllers.js @@ -34,7 +34,7 @@ netStatsApp.controller('StatsCtrl', function($scope, $filter, socket, _, toastr) $scope.latency = 0; - $scope.currentApiVersion = "0.0.7"; + $scope.currentApiVersion = "0.0.8"; $scope.predicate = ['-stats.active', '-stats.block.number', 'stats.block.propagation']; $scope.reverse = false; diff --git a/views/index.jade b/views/index.jade index 4a6fa95..b23211b 100644 --- a/views/index.jade +++ b/views/index.jade @@ -200,5 +200,5 @@ block content div.propagationBox span {{node.stats.block.propagation | blockPropagationFilter}} td.peerPropagationChart(class="{{node.id}}") - td(class="{{ node.stats | propagationNodeAvgTimeClass : node.stats.active }}") {{ node.stats.propagationAvg | blockPropagationFilter : '' }} + td(class="{{ node.stats | propagationNodeAvgTimeClass : bestBlock }}") {{ node.stats.propagationAvg | blockPropagationFilter : '' }} td(class="{{ node.stats.uptime | upTimeClass : node.stats.active }}") {{ node.stats.uptime | upTimeFilter }}