diff --git a/models/node.js b/models/node.js index 750e1d8..aaf6a91 100644 --- a/models/node.js +++ b/models/node.js @@ -43,10 +43,7 @@ Node.prototype.update = function() } if(this.info.stats.peers != null) { - this.info.stats.block.height = parseInt(eth.number); - var block = eth.block(this.info.stats.block.height) - this.info.stats.block.hash = block.hash; - this.info.stats.block.timestamp = block.timestamp; + this.info.stats.block = eth.block(parseInt(eth.number)); this.info.stats.mining = eth.mining; this.info.stats.active = true; } else { diff --git a/public/js/controllers.js b/public/js/controllers.js index 1d27dd4..bef4448 100644 --- a/public/js/controllers.js +++ b/public/js/controllers.js @@ -43,8 +43,8 @@ function StatsCtrl($scope, $filter, socket, _) { }).length; $scope.bestBlock = _.max($scope.nodes, function(node) { - return parseInt(node.stats.block.height); - }).stats.block.height; + return parseInt(node.stats.block.number); + }).stats.block.number; $scope.lastBlock = _.max($scope.nodes, function(node) { return parseInt(node.stats.block.timestamp); diff --git a/views/index.jade b/views/index.jade index 98e2b25..eb8ec74 100644 --- a/views/index.jade +++ b/views/index.jade @@ -80,8 +80,8 @@ block content td(class="{{ node.stats.peers | peerClass }}") {{node.stats.peers}} td(class="{{ node.stats.mining | miningClass }}") i(class="{{ node.stats.mining | miningIconClass }}") - td(class="{{ node.stats.block.height | blockClass : bestBlock }}") {{'#' + node.stats.block.height}} - td(class="{{ node.stats.block.height | blockClass : bestBlock }}").hidden-sm.hidden-xs + td(class="{{ node.stats.block.number | blockClass : bestBlock }}") {{'#' + node.stats.block.number}} + td(class="{{ node.stats.block.number | blockClass : bestBlock }}").hidden-sm.hidden-xs span.small {{node.stats.block.hash}} td(am-time-ago="node.stats.block.timestamp", am-preprocess="unix", class="{{ node.stats.block.timestamp | timeClass }}") ∞ td(class="{{ node.stats.uptime.total | upTimeClass }}") {{ node.stats.uptime.total | upTimeFilter }}