mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-12 10:15:52 +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()) {
|
if (Utils.isWindows()) {
|
||||||
// Work around an issue on Windows whereby you can't rename over existing files.
|
// Work around an issue on Windows whereby you can't rename over existing files.
|
||||||
File canonical = destFile.getCanonicalFile();
|
File canonical = destFile.getCanonicalFile();
|
||||||
if (canonical.delete() && temp.renameTo(canonical))
|
canonical.delete();
|
||||||
|
if (temp.renameTo(canonical))
|
||||||
return; // else fall through.
|
return; // else fall through.
|
||||||
throw new IOException("Failed to rename " + temp + " to " + canonical);
|
throw new IOException("Failed to rename " + temp + " to " + canonical);
|
||||||
} else if (!temp.renameTo(destFile)) {
|
} else if (!temp.renameTo(destFile)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user