Skip to content

Commit

Permalink
backup wallet files before saving
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Dec 27, 2024
1 parent 703ade5 commit 3e55427
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,17 +376,17 @@ public void saveWallet(MoneroWallet wallet) {
}

public void saveWallet(MoneroWallet wallet, boolean backup) {
wallet.save();
if (backup) backupWallet(getWalletName(wallet.getPath()));
wallet.save();
}

public void closeWallet(MoneroWallet wallet, boolean save) {
log.info("{}.closeWallet({}, {})", getClass().getSimpleName(), wallet.getPath(), save);
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;
}
Expand Down

0 comments on commit 3e55427

Please sign in to comment.