From 5dfbfe9a7b0f43d6c56ea2b3ef4213a798fc0bad Mon Sep 17 00:00:00 2001 From: "Richard T. Carback III" <rick.carback@gmail.com> Date: Tue, 19 Dec 2023 19:19:25 +0000 Subject: [PATCH] fix lock copy issue and update call ineffectiveness in the ud module --- ud/channelIDTracking.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ud/channelIDTracking.go b/ud/channelIDTracking.go index 31d25d198..6336989f5 100644 --- a/ud/channelIDTracking.go +++ b/ud/channelIDTracking.go @@ -4,10 +4,11 @@ import ( "crypto/ed25519" "encoding/json" "errors" - "gitlab.com/xx_network/primitives/netTime" "sync" "time" + "gitlab.com/xx_network/primitives/netTime" + jww "github.com/spf13/jwalterweatherman" "gitlab.com/elixxir/client/v4/channels" @@ -56,7 +57,7 @@ func saveRegistrationDisk(kv versioned.KV, reg registrationDisk) error { // registrationDisk is used to encapsulate the channel user's key pair, // lease and lease signature. type registrationDisk struct { - rwmutex sync.RWMutex + rwmutex *sync.RWMutex Registered bool PublicKey ed25519.PublicKey @@ -85,7 +86,7 @@ func (r registrationDisk) IsRegistered() bool { // Update updates the registrationDisk that is currently // 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() defer r.rwmutex.Unlock() -- GitLab