improved arrival time

This commit is contained in:
cubedro
2015-03-27 11:44:07 +02:00
parent 51ab249429
commit 7d0994dc24
6 changed files with 23 additions and 14 deletions

View File

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

View File

@@ -116,7 +116,6 @@ angular.module('netStatsApp.filters', [])
})
.filter('blockPropagationFilter', function() {
return function(ms) {
// ms = (new Date()).getTime() - ms;
var result = 0;
if(ms < 1000) {