mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
Merge 3980d3bf47 into e23e86921b
This commit is contained in:
commit
cf7666b85e
1 changed files with 7 additions and 1 deletions
|
|
@ -207,8 +207,14 @@ func writeKeyFile(file string, content []byte) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
f.Close()
|
f.Close()
|
||||||
|
|
||||||
|
if err := os.Rename(f.Name(), file); err != nil {
|
||||||
|
// Renaming failed, may be a data race between a cache sync, retry
|
||||||
|
time.Sleep(100 * time.Millisecond)
|
||||||
return os.Rename(f.Name(), file)
|
return os.Rename(f.Name(), file)
|
||||||
}
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// keyFileName implements the naming convention for keyfiles:
|
// keyFileName implements the naming convention for keyfiles:
|
||||||
// UTC--<created_at UTC ISO8601>-<address hex>
|
// UTC--<created_at UTC ISO8601>-<address hex>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue