Fix/stuck on keys saved (#3823)

* fixed: getting stuck on the "Keys saved" randomly

* bump version
This commit is contained in:
frank 2023-08-01 17:09:23 +08:00 committed by GitHub
parent 1df8c1c511
commit b81ad3fcac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 9 deletions

View File

@ -1 +1 @@
0.162.12 0.162.13

View File

@ -12,8 +12,6 @@ import (
"sync" "sync"
"time" "time"
"github.com/status-im/status-go/timesource"
"github.com/status-im/status-go/images" "github.com/status-im/status-go/images"
"github.com/imdario/mergo" "github.com/imdario/mergo"
@ -1139,11 +1137,7 @@ func (b *GethStatusBackend) CreateAccountAndLogin(request *requests.CreateAccoun
if err := request.Validate(); err != nil { if err := request.Validate(); err != nil {
return err return err
} }
customizationColorClock, err := timesource.GetCurrentTimeInMillis() return b.generateOrImportAccount("", 1, request)
if err != nil {
return err
}
return b.generateOrImportAccount("", customizationColorClock, request)
} }
func (b *GethStatusBackend) ConvertToRegularAccount(mnemonic string, currPassword string, newPassword string) error { func (b *GethStatusBackend) ConvertToRegularAccount(mnemonic string, currPassword string, newPassword string) error {

View File

@ -189,6 +189,12 @@ func (s *NTPTimeSource) updateOffset() error {
offset, err := computeOffset(s.timeQuery, s.servers, s.allowedFailures) offset, err := computeOffset(s.timeQuery, s.servers, s.allowedFailures)
if err != nil { if err != nil {
log.Error("failed to compute offset", "error", err) 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 return errUpdateOffset
} }
log.Info("Difference with ntp servers", "offset", offset) log.Info("Difference with ntp servers", "offset", offset)
@ -262,5 +268,8 @@ func GetCurrentTimeInMillis() (uint64, error) {
ts.AddCallback(func(now time.Time) { ts.AddCallback(func(now time.Time) {
t = uint64(now.UnixNano() / int64(time.Millisecond)) t = uint64(now.UnixNano() / int64(time.Millisecond))
}).Wait() }).Wait()
return t, nil if ts.updatedOffset {
return t, nil
}
return 0, errUpdateOffset
} }