diff --git a/VERSION b/VERSION index 677388ade..829fca46d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.162.12 +0.162.13 diff --git a/api/geth_backend.go b/api/geth_backend.go index 3c764d60e..878e363eb 100644 --- a/api/geth_backend.go +++ b/api/geth_backend.go @@ -12,8 +12,6 @@ import ( "sync" "time" - "github.com/status-im/status-go/timesource" - "github.com/status-im/status-go/images" "github.com/imdario/mergo" @@ -1139,11 +1137,7 @@ func (b *GethStatusBackend) CreateAccountAndLogin(request *requests.CreateAccoun if err := request.Validate(); err != nil { return err } - customizationColorClock, err := timesource.GetCurrentTimeInMillis() - if err != nil { - return err - } - return b.generateOrImportAccount("", customizationColorClock, request) + return b.generateOrImportAccount("", 1, request) } func (b *GethStatusBackend) ConvertToRegularAccount(mnemonic string, currPassword string, newPassword string) error { diff --git a/timesource/timesource.go b/timesource/timesource.go index 6d53e6d99..477b56598 100644 --- a/timesource/timesource.go +++ b/timesource/timesource.go @@ -189,6 +189,12 @@ func (s *NTPTimeSource) updateOffset() error { offset, err := computeOffset(s.timeQuery, s.servers, s.allowedFailures) if err != nil { log.Error("failed to compute offset", "error", err) + s.mu.Lock() + defer s.mu.Unlock() + for _, c := range s.callbacks { + c.callback(now()) + c.wg.Done() + } return errUpdateOffset } log.Info("Difference with ntp servers", "offset", offset) @@ -262,5 +268,8 @@ func GetCurrentTimeInMillis() (uint64, error) { ts.AddCallback(func(now time.Time) { t = uint64(now.UnixNano() / int64(time.Millisecond)) }).Wait() - return t, nil + if ts.updatedOffset { + return t, nil + } + return 0, errUpdateOffset }