Skip to content
Snippets Groups Projects
Commit a2e32ea9 authored by Jonah Husson's avatar Jonah Husson
Browse files

exclude from number to go as well

parent aa335e9b
Branches
Tags
2 merge requests!67Release,!63Exclude stale nodes from numRegistered
...@@ -539,8 +539,10 @@ func (c *Client) GetNodeRegistrationStatus() (int, int, error) { ...@@ -539,8 +539,10 @@ func (c *Client) GetNodeRegistrationStatus() (int, int, error) {
cmixStore := c.storage.Cmix() cmixStore := c.storage.Cmix()
var numRegistered int var numRegistered int
var numStale = 0
for i, n := range nodes { for i, n := range nodes {
if n.Status == ndf.Stale { if n.Status == ndf.Stale {
numStale += 1
continue continue
} }
nid, err := id.Unmarshal(n.ID) nid, err := id.Unmarshal(n.ID)
...@@ -554,7 +556,7 @@ func (c *Client) GetNodeRegistrationStatus() (int, int, error) { ...@@ -554,7 +556,7 @@ func (c *Client) GetNodeRegistrationStatus() (int, int, error) {
} }
// Get the number of in progress node registrations // Get the number of in progress node registrations
return numRegistered, len(nodes), nil return numRegistered, len(nodes) - numStale, nil
} }
// DeleteContact is a function which removes a partner from Client's storage // DeleteContact is a function which removes a partner from Client's storage
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment