From 012f3f654c85cc656e4c8d74dd87b561f1f5949c Mon Sep 17 00:00:00 2001 From: cubedro Date: Sat, 4 Apr 2015 22:45:08 +0300 Subject: [PATCH] fixed propagation --- public/js/controllers.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/public/js/controllers.js b/public/js/controllers.js index 50d570a..799ef61 100644 --- a/public/js/controllers.js +++ b/public/js/controllers.js @@ -74,7 +74,16 @@ function StatsCtrl($scope, $filter, socket, _, toastr) { break; 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; case "info":