Skip to content
Snippets Groups Projects
Commit 5dfbfe9a authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

fix lock copy issue and update call ineffectiveness in the ud module

parent 81e06369
No related branches found
No related tags found
No related merge requests found
...@@ -4,10 +4,11 @@ import ( ...@@ -4,10 +4,11 @@ import (
"crypto/ed25519" "crypto/ed25519"
"encoding/json" "encoding/json"
"errors" "errors"
"gitlab.com/xx_network/primitives/netTime"
"sync" "sync"
"time" "time"
"gitlab.com/xx_network/primitives/netTime"
jww "github.com/spf13/jwalterweatherman" jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/v4/channels" "gitlab.com/elixxir/client/v4/channels"
...@@ -56,7 +57,7 @@ func saveRegistrationDisk(kv versioned.KV, reg registrationDisk) error { ...@@ -56,7 +57,7 @@ func saveRegistrationDisk(kv versioned.KV, reg registrationDisk) error {
// registrationDisk is used to encapsulate the channel user's key pair, // registrationDisk is used to encapsulate the channel user's key pair,
// lease and lease signature. // lease and lease signature.
type registrationDisk struct { type registrationDisk struct {
rwmutex sync.RWMutex rwmutex *sync.RWMutex
Registered bool Registered bool
PublicKey ed25519.PublicKey PublicKey ed25519.PublicKey
...@@ -85,7 +86,7 @@ func (r registrationDisk) IsRegistered() bool { ...@@ -85,7 +86,7 @@ func (r registrationDisk) IsRegistered() bool {
// Update updates the registrationDisk that is currently // Update updates the registrationDisk that is currently
// stored on the kv with a new lease and lease signature. // stored on the kv with a new lease and lease signature.
func (r registrationDisk) Update(lease int64, signature []byte) { func (r *registrationDisk) Update(lease int64, signature []byte) {
r.rwmutex.Lock() r.rwmutex.Lock()
defer r.rwmutex.Unlock() defer r.rwmutex.Unlock()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment