backup monero wallet

This commit is contained in:
premek 2021-05-31 00:47:04 +02:00 committed by woodser
parent dc2a5becf0
commit aba3c1b82e
2 changed files with 6 additions and 4 deletions

View File

@ -348,7 +348,7 @@ public class WalletConfig extends AbstractIdleService {
// XMR wallet
String xmrPrefix = "_XMR";
vXmrWalletFile = new File(directory, filePrefix + xmrPrefix); // TODO: *.wallet?
vXmrWalletFile = new File(directory, filePrefix + xmrPrefix);
if (MoneroUtils.walletExists(vXmrWalletFile.getPath())) {
vXmrWallet = openWallet(new MoneroWalletConfig().setPath(filePrefix + xmrPrefix).setPassword("abctesting123"));
} else {

View File

@ -131,7 +131,7 @@ public class WalletsSetup {
private final Config config;
private final LocalBitcoinNode localBitcoinNode;
private final BtcNodes btcNodes;
private final String btcWalletFileName;
private final String xmrWalletFileName;
private final int numConnectionsForBtc;
private final String userAgent;
private final NetworkParameters params;
@ -179,7 +179,7 @@ public class WalletsSetup {
this.socks5DiscoverMode = evaluateMode(socks5DiscoverModeString);
this.walletDir = walletDir;
btcWalletFileName = "bisq_" + config.baseCurrencyNetwork.getCurrencyCode() + ".wallet";
xmrWalletFileName = "bisq_" + config.baseCurrencyNetwork.getCurrencyCode();
params = Config.baseCurrencyNetworkParameters();
PeerGroup.setIgnoreHttpSeeds(true);
}
@ -424,7 +424,9 @@ public class WalletsSetup {
///////////////////////////////////////////////////////////////////////////////////////////
public void backupWallets() {
FileUtil.rollingBackup(walletDir, btcWalletFileName, 20);
FileUtil.rollingBackup(walletDir, xmrWalletFileName, 20);
FileUtil.rollingBackup(walletDir, xmrWalletFileName + ".keys", 20);
FileUtil.rollingBackup(walletDir, xmrWalletFileName + ".address.txt", 20);
FileUtil.rollingBackup(walletDir, BSQ_WALLET_FILE_NAME, 20);
}