Merge pull request #224 from cubedro/develop

Fixed nodes status
pull/5/head
Marian OANCΞA 9 years ago
commit f886e78648
  1. 8
      src-lite/js/filters.js

@ -527,13 +527,13 @@ angular.module('netStatsApp.filters', [])
for(var x = 0; x < nodes.length; x++) for(var x = 0; x < nodes.length; x++)
{ {
if(nodes[x].stats.block.number === bestBlock.number && nodes[x].stats.block.hash !== bestBlock.hash) if(nodes[x].stats.block.number === bestBlock.block.number && nodes[x].stats.block.hash !== bestBlock.block.hash)
return 'danger'; return 'danger';
if((bestBlock.number - nodes[x].stats.block.number) > 1 && (now - bestBlock.received) >= 20*1000) if((bestBlock.block.number - nodes[x].stats.block.number) > 1 && (now - bestBlock.block.received) >= 20*1000)
status = 'orange'; status = 'orange';
if((bestBlock.number - nodes[x].stats.block.number) === 1 && (now - bestBlock.received) >= 10*1000 && status !== 'orange') if((bestBlock.block.number - nodes[x].stats.block.number) === 1 && (now - bestBlock.block.received) >= 10*1000 && status !== 'orange')
status = 'warning'; status = 'warning';
} }
@ -546,7 +546,7 @@ angular.module('netStatsApp.filters', [])
for(var x = 0; x < nodes.length; x++) for(var x = 0; x < nodes.length; x++)
{ {
if(nodes[x].stats.block.number === bestBlock.number && nodes[x].stats.block.hash === bestBlock.hash) if(nodes[x].stats.block.number === bestBlock.block.number && nodes[x].stats.block.hash === bestBlock.block.hash)
cnt++; cnt++;
} }

Loading…
Cancel
Save