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