diff --git a/disksync.go b/disksync.go index 1779c96..de58815 100644 --- a/disksync.go +++ b/disksync.go @@ -399,6 +399,10 @@ func (a *Account) writeWallet(dir string) error { return err } + if err := tmpfile.Sync(); err != nil { + return err + } + tmppath := tmpfile.Name() if err := tmpfile.Close(); err != nil { log.Warnf("Cannot close temporary wallet file: %v", err) @@ -419,6 +423,10 @@ func (a *Account) writeTxStore(dir string) error { return err } + if err := tmpfile.Sync(); err != nil { + return err + } + tmppath := tmpfile.Name() if err := tmpfile.Close(); err != nil { log.Warnf("Cannot close temporary txstore file: %v", err)