diff --git a/network/node/register.go b/network/node/register.go index aa80a5c5da6255c18a5f96e2171912cef3f7f32c..82ab2cc3d937245adbc63812d6e875bc63657845 100644 --- a/network/node/register.go +++ b/network/node/register.go @@ -60,7 +60,7 @@ func registerNodes(sender *gateway.Sender, session *storage.Session, rngGen *fas u := session.User() regSignature := u.GetTransmissionRegistrationValidationSignature() // Timestamp in which user has registered with permissioning - regTimestamp := u.GetRegistrationTimestampNano() + regTimestamp := u.GetRegistrationTimestamp().UnixNano() uci := u.GetCryptographicIdentity() cmix := session.Cmix() diff --git a/storage/user/registation.go b/storage/user/registation.go index 4913802216e3ca278bcb5946256725c23ac1be1c..cfc32f1b87a82328891eeb646bf743436ec8416e 100644 --- a/storage/user/registation.go +++ b/storage/user/registation.go @@ -36,13 +36,6 @@ func (u *User) GetReceptionRegistrationValidationSignature() []byte { return u.receptionRegValidationSig } -// Returns the registration timestamp stored in RAM as int64 -func (u *User) GetRegistrationTimestampNano() int64 { - u.rvsMux.RLock() - defer u.rvsMux.RUnlock() - return u.registrationTimestamp.UnixNano() -} - // Returns the registration timestamp stored in RAM as func (u *User) GetRegistrationTimestamp() time.Time { u.rvsMux.RLock() diff --git a/storage/user/registation_test.go b/storage/user/registation_test.go index 0011f9e7b6b85409efb74f1eb115bf6ede6fbe17..43dd65241477d7e23bf9204a4d44b711c6133d55 100644 --- a/storage/user/registation_test.go +++ b/storage/user/registation_test.go @@ -176,9 +176,9 @@ func TestUser_GetRegistrationTimestamp(t *testing.T) { "\n\tExpected: %d\n\tReceieved: %d", testTime.UnixNano(), unixNano) } - if testTime.UnixNano() != u.GetRegistrationTimestampNano() { + if testTime.UnixNano() != u.GetRegistrationTimestamp().UnixNano() { t.Errorf("Timestamp from GetRegistrationTimestampNano was not expected."+ - "\n\tExpected: %d\n\tReceieved: %d", testTime.UnixNano(), u.GetRegistrationTimestampNano()) + "\n\tExpected: %d\n\tReceieved: %d", testTime.UnixNano(), u.GetRegistrationTimestamp().UnixNano()) } if !testTime.Equal(u.GetRegistrationTimestamp()) { diff --git a/ud/register.go b/ud/register.go index dfb6da246ec69437c1aa0bea4733696ad7357853..c2dd6a0adc1db8f9e61495c9b989309657f6d891 100644 --- a/ud/register.go +++ b/ud/register.go @@ -49,7 +49,7 @@ func (m *Manager) register(username string, comm registerUserComms) error { Salt: cryptoUser.GetReceptionSalt(), }, UID: cryptoUser.GetReceptionID().Marshal(), - Timestamp: user.GetRegistrationTimestampNano(), + Timestamp: user.GetRegistrationTimestamp().UnixNano(), } // Sign the identity data and add to user registration message