@@ -804,7 +804,8 @@ type Health struct {
804804 ConnectNN bool // whether node is connected to all its neighbours
805805 CountConnectNN int // amount of neighbours connected to
806806 MissingConnectNN [][]byte // which neighbours we should have been connected to but we're not
807- Saturated bool // whether we are connected to all the peers we would have liked to
807+ Potent bool // whether we are connected a mininum of peers for bins we know of peers
808+ Saturation int // whether we are connected to all the peers we would have liked to
808809 Hive string
809810}
810811
@@ -819,20 +820,21 @@ type Health struct {
819820func (k * Kademlia ) Healthy (pp * PeerPot ) * Health {
820821 k .lock .RLock ()
821822 defer k .lock .RUnlock ()
822- connectnn , countconnectnn , culpritsconnectnn := k .connectedNeighbours (pp .NNSet )
823- knownn , countknownn , culpritsknownn := k .knowNeighbours (pp .NNSet )
823+ connectnn , countconnectnn , missingconnectnn := k .connectedNeighbours (pp .NNSet )
824+ knownn , countknownn , missingknownn := k .knowNeighbours (pp .NNSet )
824825 impotentBins := k .connectedPotential ()
825826 saturation := k .saturation ()
826827 log .Trace (fmt .Sprintf ("%08x: healthy: knowNNs: %v, connectNNs: %v, saturated: %v\n " , k .base , knownn , connectnn , saturation ))
827828 potent := countknownn == 0 || len (impotentBins ) == 0
828829 return & Health {
829830 KnowNN : knownn ,
830831 CountKnowNN : countknownn ,
831- MissingKnowNN : culpritsknownn ,
832- ConnectNN : gotnn ,
833- CountConnectNN : countgotnn ,
834- MissingConnectNN : culpritsgotnn ,
835- Saturated : saturated ,
832+ MissingKnowNN : missingknownn ,
833+ ConnectNN : connectnn ,
834+ CountConnectNN : countconnectnn ,
835+ MissingConnectNN : missingconnectnn ,
836+ Potent : potent ,
837+ Saturation : saturation ,
836838 Hive : k .string (),
837839 }
838840}
0 commit comments