Skip to content
Snippets Groups Projects
Commit 01a4c858 authored by Jono Wenger's avatar Jono Wenger
Browse files

Add debug prints to cmix/identity/manager.track when a new identity is added

parent 45bfa35f
No related branches found
No related tags found
3 merge requests!510Release,!207WIP: Client Restructure,!203Symmetric broadcast
...@@ -189,13 +189,18 @@ func (t *manager) track(stop *stoppable.Single) { ...@@ -189,13 +189,18 @@ func (t *manager) track(stop *stoppable.Single) {
// Sleep until the last ID has expired // Sleep until the last ID has expired
select { select {
case <-time.NewTimer(nextUpdate.Sub(nextUpdate)).C: case <-time.After(nextUpdate.Sub(nextUpdate)):
case newIdentity := <-t.newIdentity: case newIdentity := <-t.newIdentity:
jww.DEBUG.Printf("Receiving new identity %s :%+v",
newIdentity.Source, newIdentity)
// If the identity is old, then update its properties // If the identity is old, then update its properties
isOld := false isOld := false
for i := range t.tracked { for i := range t.tracked {
inQuestion := t.tracked[i] inQuestion := t.tracked[i]
if inQuestion.Source.Cmp(newIdentity.Source) { if inQuestion.Source.Cmp(newIdentity.Source) {
jww.DEBUG.Printf(
"Updating old identity %s", newIdentity.Source)
inQuestion.Persistent = newIdentity.Persistent inQuestion.Persistent = newIdentity.Persistent
inQuestion.ValidUntil = newIdentity.ValidUntil inQuestion.ValidUntil = newIdentity.ValidUntil
isOld = true isOld = true
...@@ -203,6 +208,7 @@ func (t *manager) track(stop *stoppable.Single) { ...@@ -203,6 +208,7 @@ func (t *manager) track(stop *stoppable.Single) {
} }
} }
if !isOld { if !isOld {
jww.DEBUG.Printf("Tracking new identity %s", newIdentity.Source)
// Otherwise, add it to the list and run // Otherwise, add it to the list and run
t.tracked = append(t.tracked, newIdentity) t.tracked = append(t.tracked, newIdentity)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment