fix reference to backup cache file
Some checks failed
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
Codacy Coverage Reporter / Publish coverage (push) Has been cancelled
CI / build (macos-13) (push) Has been cancelled

This commit is contained in:
woodser 2024-09-13 12:17:37 -04:00
parent 874075b371
commit dc0938d49c

View file

@ -1503,15 +1503,15 @@ public class XmrWalletService extends XmrWalletBase {
} }
// handle success or failure // handle success or failure
File originalCacheBackup = new File(cachePath + ".backup");
if (retrySuccessful) { if (retrySuccessful) {
originalCacheFile.delete(); // delete original wallet cache backup if (originalCacheBackup.exists()) originalCacheBackup.delete(); // delete original wallet cache backup
} else { } else {
// restore original wallet cache // restore original wallet cache
log.warn("Failed to open full wallet using backup cache, restoring original cache"); log.warn("Failed to open full wallet using backup cache, restoring original cache");
File cacheFile = new File(cachePath); File cacheFile = new File(cachePath);
if (cacheFile.exists()) cacheFile.delete(); if (cacheFile.exists()) cacheFile.delete();
File originalCacheBackup = new File(cachePath + ".backup");
if (originalCacheBackup.exists()) originalCacheBackup.renameTo(new File(cachePath)); if (originalCacheBackup.exists()) originalCacheBackup.renameTo(new File(cachePath));
// throw exception // throw exception
@ -1607,15 +1607,15 @@ public class XmrWalletService extends XmrWalletBase {
} }
// handle success or failure // handle success or failure
File originalCacheBackup = new File(cachePath + ".backup");
if (retrySuccessful) { if (retrySuccessful) {
originalCacheFile.delete(); // delete original wallet cache backup if (originalCacheBackup.exists()) originalCacheBackup.delete(); // delete original wallet cache backup
} else { } else {
// restore original wallet cache // restore original wallet cache
log.warn("Failed to open RPC wallet using backup cache, restoring original cache"); log.warn("Failed to open RPC wallet using backup cache, restoring original cache");
File cacheFile = new File(cachePath); File cacheFile = new File(cachePath);
if (cacheFile.exists()) cacheFile.delete(); if (cacheFile.exists()) cacheFile.delete();
File originalCacheBackup = new File(cachePath + ".backup");
if (originalCacheBackup.exists()) originalCacheBackup.renameTo(new File(cachePath)); if (originalCacheBackup.exists()) originalCacheBackup.renameTo(new File(cachePath));
// throw exception // throw exception