backup wallet files before saving

This commit is contained in:
woodser 2024-12-27 08:09:54 -05:00
parent c1b17cf612
commit 0462ddc273

View file

@ -376,8 +376,8 @@ public class XmrWalletService extends XmrWalletBase {
}
public void saveWallet(MoneroWallet wallet, boolean backup) {
wallet.save();
if (backup) backupWallet(getWalletName(wallet.getPath()));
wallet.save();
}
public void closeWallet(MoneroWallet wallet, boolean save) {
@ -385,8 +385,8 @@ public class XmrWalletService extends XmrWalletBase {
MoneroError err = null;
String path = wallet.getPath();
try {
wallet.close(save);
if (save) backupWallet(getWalletName(path));
if (save) saveWallet(wallet, true);
wallet.close();
} catch (MoneroError e) {
err = e;
}