gocritic (2/2) (#3864)

Refs #3262
This commit is contained in:
Marko
2019-08-02 10:53:52 +04:00
committed by Anton Kaliaev
parent 14fa800773
commit f9cce282da
26 changed files with 120 additions and 90 deletions
+4 -3
View File
@@ -163,11 +163,12 @@ func (n *Network) updateHealth() {
// TODO: make sure they're all at the same height (within a block)
// and all proposing (and possibly validating ) Alternatively, just
// check there hasn't been a new round in numValidators rounds
if n.NumValidators != 0 && n.NumNodesMonitoredOnline == n.NumValidators {
switch {
case n.NumValidators != 0 && n.NumNodesMonitoredOnline == n.NumValidators:
n.Health = FullHealth
} else if n.NumNodesMonitoredOnline > 0 && n.NumNodesMonitoredOnline <= n.NumNodesMonitored {
case n.NumNodesMonitoredOnline > 0 && n.NumNodesMonitoredOnline <= n.NumNodesMonitored:
n.Health = ModerateHealth
} else {
default:
n.Health = Dead
}
}