Merge pull request #37 from cubedro/develop

Fixed propagation
This commit is contained in:
Marian OANCΞA 2015-04-04 22:48:18 +03:00
commit f4bdb6d7ee
2 changed files with 11 additions and 2 deletions

View File

@ -74,7 +74,16 @@ function StatsCtrl($scope, $filter, socket, _, toastr) {
break; break;
case "update": case "update":
$scope.nodes[findIndex({id: data.id})].stats = data.stats; var index = findIndex({id: data.id});
if(data.stats.block.number > $scope.nodes[index].stats.block.number) {
data.stats.block.firstarrived = (data.stats.block.number > $scope.bestBlock ? data.stats.block.received : $scope.lastBlock);
} else {
data.stats.block.firstarrived = $scope.nodes[index].stats.block.firstarrived;
}
$scope.nodes[index].stats = data.stats;
break; break;
case "info": case "info":

View File

@ -140,5 +140,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.transactions.length || 0}} td(style="padding-left: 18px;") {{node.stats.block.transactions.length || 0}}
td(class="{{ node.stats.block.timestamp | timeClass }}") {{node.stats.block.received | blockTimeFilter }} td(class="{{ node.stats.block.timestamp | timeClass }}") {{node.stats.block.received | blockTimeFilter }}
td(class="{{ node.stats.block.received | propagationTimeClass : lastBlock }}") {{node.stats.block.received | blockPropagationFilter : lastBlock}} td(class="{{ node.stats.block.received | propagationTimeClass : node.stats.block.firstarrived }}") {{node.stats.block.received | blockPropagationFilter : node.stats.block.firstarrived}}
td(class="{{ node.stats.uptime | upTimeClass }}") {{ node.stats.uptime | upTimeFilter }} td(class="{{ node.stats.uptime | upTimeClass }}") {{ node.stats.uptime | upTimeFilter }}