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

Set extrachekcs in tracker

parent 43a13894
No related branches found
No related tags found
2 merge requests!117Release,!80Fix extraChecks
......@@ -10,6 +10,7 @@ package ephemeral
import (
"github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/interfaces"
"gitlab.com/elixxir/client/stoppable"
"gitlab.com/elixxir/client/storage"
"gitlab.com/elixxir/client/storage/reception"
......@@ -149,6 +150,7 @@ func generateIdentities(protoIds []ephemeral.ProtoIdentity, ourId *id.ID,
StartValid: eid.Start.Add(-validityGracePeriod),
EndValid: eid.End.Add(validityGracePeriod),
Ephemeral: false,
ExtraChecks: interfaces.DefaultExtraChecks,
}
}
......
......@@ -11,6 +11,7 @@ import (
"fmt"
"github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/interfaces"
"gitlab.com/elixxir/client/interfaces/params"
"gitlab.com/elixxir/client/interfaces/utility"
"gitlab.com/elixxir/client/storage/reception"
......@@ -92,7 +93,7 @@ func (m *Manager) transmitSingleUse(partner contact2.Contact, payload []byte,
Source: rid,
AddressSize: addressSize,
End: timeStart.Add(2 * timeout),
ExtraChecks: 10,
ExtraChecks: interfaces.DefaultExtraChecks,
StartValid: timeStart.Add(-2 * timeout),
EndValid: timeStart.Add(2 * timeout),
Ephemeral: true,
......
......@@ -176,7 +176,7 @@ func (s *Store) AddIdentity(identity Identity) error {
// Do not make duplicates of IDs
if _, ok := s.present[idH]; ok {
jww.DEBUG.Printf("Ignoring duplicate identity for %d (%s)",
identity.EphId, identity.Source)
identity.EphId.Int64(), identity.Source)
return nil
}
......@@ -248,6 +248,7 @@ func (s *Store) SetToExpire(addressSize uint8) {
func (s *Store) prune(now time.Time) {
lengthBefore := len(s.active)
var pruned []int64
// Prune the list
for i := 0; i < len(s.active); i++ {
......@@ -257,6 +258,7 @@ func (s *Store) prune(now time.Time) {
jww.ERROR.Printf("Failed to delete Identity for %s: %+v",
inQuestion, err)
}
pruned = append(pruned, inQuestion.EphId.Int64())
s.active = append(s.active[:i], s.active[i+1:]...)
......@@ -266,7 +268,7 @@ func (s *Store) prune(now time.Time) {
// Save the list if it changed
if lengthBefore != len(s.active) {
jww.INFO.Printf("Pruned %d identities", lengthBefore-len(s.active))
jww.INFO.Printf("Pruned %d identities [%+v]", lengthBefore-len(s.active), pruned)
if err := s.save(); err != nil {
jww.FATAL.Panicf("Failed to store reception storage: %+v", err)
}
......
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