Skip to content
Snippets Groups Projects
Commit 436fc20f authored by David Stainton's avatar David Stainton
Browse files

WIP

parent df32e981
No related branches found
No related tags found
6 merge requests!510Release,!419rewrote the health tracker to both consider if there are waiting rounds and...,!371[Channel RSAtoPrivate] Implement Reverse Asymmetric in Client/Broadcast,!354Channels impl,!340Project/channels,!338Xx 4055/channel identity tracking
...@@ -203,10 +203,12 @@ func (c *clientIDTracker) Start() (stoppable.Stoppable, error) { ...@@ -203,10 +203,12 @@ func (c *clientIDTracker) Start() (stoppable.Stoppable, error) {
} }
func (c *clientIDTracker) registrationWorker(stopper *stoppable.Single) { func (c *clientIDTracker) registrationWorker(stopper *stoppable.Single) {
for { for {
if time.Now().After(c.registrationDisk.GetLease().Add(-graceDuration)) { if time.Now().After(c.registrationDisk.GetLease().Add(-graceDuration)) {
c.register() err := c.register()
if err != nil {
jww.FATAL.Panic(err)
}
} }
select { select {
...@@ -221,7 +223,6 @@ func (c *clientIDTracker) registrationWorker(stopper *stoppable.Single) { ...@@ -221,7 +223,6 @@ func (c *clientIDTracker) registrationWorker(stopper *stoppable.Single) {
return return
case <-time.After(time.Second): case <-time.After(time.Second):
} }
} }
} }
......
...@@ -71,7 +71,10 @@ func TestChannelIDTracking(t *testing.T) { ...@@ -71,7 +71,10 @@ func TestChannelIDTracking(t *testing.T) {
myTestClientIDTracker := newclientIDTracker(comms, host, username, myTestClientIDTracker := newclientIDTracker(comms, host, username,
kv, m.user.GetReceptionIdentity(), ed25519.PublicKey(udPubKeyBytes), rngGen) kv, m.user.GetReceptionIdentity(), ed25519.PublicKey(udPubKeyBytes), rngGen)
stopper, err := myTestClientIDTracker.Start() //stopper, err := myTestClientIDTracker.Start()
//require.NoError(t, err)
err = myTestClientIDTracker.register()
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, myTestClientIDTracker.GetUsername(), username) require.Equal(t, myTestClientIDTracker.GetUsername(), username)
...@@ -90,6 +93,6 @@ func TestChannelIDTracking(t *testing.T) { ...@@ -90,6 +93,6 @@ func TestChannelIDTracking(t *testing.T) {
//_ = myTestClientIDTracker.ValidateChannelMessage(username, lease, pubKey, authorIDSignature) //_ = myTestClientIDTracker.ValidateChannelMessage(username, lease, pubKey, authorIDSignature)
err = stopper.Close() //err = stopper.Close()
require.NoError(t, err) //require.NoError(t, err)
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment