3
0
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:
Mike Hearn 2013-03-13 12:23:12 +01:00
parent 9bc9a4b262
commit e140662ea2

View File

@ -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)) {