Sync temporary files before closing and renaming.
This commit is contained in:
parent
cb6969843b
commit
72c7d05159
1 changed files with 8 additions and 0 deletions
|
@ -399,6 +399,10 @@ func (a *Account) writeWallet(dir string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := tmpfile.Sync(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
tmppath := tmpfile.Name()
|
tmppath := tmpfile.Name()
|
||||||
if err := tmpfile.Close(); err != nil {
|
if err := tmpfile.Close(); err != nil {
|
||||||
log.Warnf("Cannot close temporary wallet file: %v", err)
|
log.Warnf("Cannot close temporary wallet file: %v", err)
|
||||||
|
@ -419,6 +423,10 @@ func (a *Account) writeTxStore(dir string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := tmpfile.Sync(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
tmppath := tmpfile.Name()
|
tmppath := tmpfile.Name()
|
||||||
if err := tmpfile.Close(); err != nil {
|
if err := tmpfile.Close(); err != nil {
|
||||||
log.Warnf("Cannot close temporary txstore file: %v", err)
|
log.Warnf("Cannot close temporary txstore file: %v", err)
|
||||||
|
|
Loading…
Reference in a new issue