Skip to content
Snippets Groups Projects
Commit 39ff2ddc authored by Jake Taylor's avatar Jake Taylor
Browse files

skip stale node registration

parent df0f6178
No related branches found
No related tags found
2 merge requests!117Release,!108skip stale node registration
...@@ -31,6 +31,7 @@ import ( ...@@ -31,6 +31,7 @@ import (
"gitlab.com/xx_network/crypto/signature/rsa" "gitlab.com/xx_network/crypto/signature/rsa"
"gitlab.com/xx_network/crypto/tls" "gitlab.com/xx_network/crypto/tls"
"gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/ndf"
"gitlab.com/xx_network/primitives/netTime" "gitlab.com/xx_network/primitives/netTime"
"strconv" "strconv"
"sync" "sync"
...@@ -83,6 +84,10 @@ func registerNodes(sender *gateway.Sender, session *storage.Session, ...@@ -83,6 +84,10 @@ func registerNodes(sender *gateway.Sender, session *storage.Session,
if _, operating := inProgress.LoadOrStore(nidStr, struct{}{}); operating { if _, operating := inProgress.LoadOrStore(nidStr, struct{}{}); operating {
continue continue
} }
// No need to register with stale nodes
if isStale := gw.Node.Status == ndf.Stale; isStale {
continue
}
err := registerWithNode(sender, comms, gw, regSignature, err := registerWithNode(sender, comms, gw, regSignature,
regTimestamp, uci, cmix, rng, stop) regTimestamp, uci, cmix, rng, stop)
inProgress.Delete(nidStr) inProgress.Delete(nidStr)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment