added block number check

This commit is contained in:
cubedro 2015-03-26 17:01:44 +02:00
parent 2b9aa3adef
commit 3c7957911c
2 changed files with 4 additions and 2 deletions

View File

@ -69,7 +69,9 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
break; break;
case "update": case "update":
if(typeof $scope.nodes[findIndex({id: data.id})].stats !== 'undefined' && typeof $scope.nodes[findIndex({id: data.id})].stats.block !== 'undefined' && $scope.nodes[findIndex({id: data.id})].stats.block.number != data.stats.block.number){
data.stats.block.when = (new Date()).getTime() - data.stats.block.arrival; data.stats.block.when = (new Date()).getTime() - data.stats.block.arrival;
}
$scope.nodes[findIndex({id: data.id})].stats = data.stats; $scope.nodes[findIndex({id: data.id})].stats = data.stats;
break; break;

View File

@ -128,5 +128,5 @@ block content
//- div.small Difficulty: {{node.stats.block.difficulty | gasFilter}} | Gas used: {{node.stats.block.gasUsed | gasFilter}} | Min gas price: {{node.stats.block.minGasPrice | gasFilter}} | Gas limit: {{node.stats.block.gasLimit | gasFilter}} //- div.small Difficulty: {{node.stats.block.difficulty | gasFilter}} | Gas used: {{node.stats.block.gasUsed | gasFilter}} | Min gas price: {{node.stats.block.minGasPrice | gasFilter}} | Gas limit: {{node.stats.block.gasLimit | gasFilter}}
td(style="padding-left: 18px;") {{node.stats.block.txCount}} td(style="padding-left: 18px;") {{node.stats.block.txCount}}
td(class="{{ node.stats.block.timestamp | timeClass }}") {{node.stats.block.timestamp | blockTimeFilter }} td(class="{{ node.stats.block.timestamp | timeClass }}") {{node.stats.block.timestamp | blockTimeFilter }}
td(class="{{ node.stats.block.propagation | propagationTimeClass }}") {{node.stats.block.when | blockPropagationFilter}} td(class="{{ node.stats.block.when | propagationTimeClass }}") {{node.stats.block.when | blockPropagationFilter}}
td(class="{{ node.stats.uptime | upTimeClass }}") {{ node.stats.uptime | upTimeFilter }} td(class="{{ node.stats.uptime | upTimeClass }}") {{ node.stats.uptime | upTimeFilter }}