mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-07 23:03:04 +00:00
Fix a regression in saving wallets on Windows.
This commit is contained in:
parent
9bc9a4b262
commit
e140662ea2
@ -361,7 +361,8 @@ public class Wallet implements Serializable, BlockChainListener {
|
||||
if (Utils.isWindows()) {
|
||||
// Work around an issue on Windows whereby you can't rename over existing files.
|
||||
File canonical = destFile.getCanonicalFile();
|
||||
if (canonical.delete() && temp.renameTo(canonical))
|
||||
canonical.delete();
|
||||
if (temp.renameTo(canonical))
|
||||
return; // else fall through.
|
||||
throw new IOException("Failed to rename " + temp + " to " + canonical);
|
||||
} else if (!temp.renameTo(destFile)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user