From aba3c1b82ec0008542a8f3476a5ff2f053af0fdd Mon Sep 17 00:00:00 2001 From: premek <1145361+premek@users.noreply.github.com> Date: Mon, 31 May 2021 00:47:04 +0200 Subject: [PATCH] backup monero wallet --- core/src/main/java/bisq/core/btc/setup/WalletConfig.java | 2 +- core/src/main/java/bisq/core/btc/setup/WalletsSetup.java | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/bisq/core/btc/setup/WalletConfig.java b/core/src/main/java/bisq/core/btc/setup/WalletConfig.java index c01bdf62f6..6958c7a464 100644 --- a/core/src/main/java/bisq/core/btc/setup/WalletConfig.java +++ b/core/src/main/java/bisq/core/btc/setup/WalletConfig.java @@ -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 { diff --git a/core/src/main/java/bisq/core/btc/setup/WalletsSetup.java b/core/src/main/java/bisq/core/btc/setup/WalletsSetup.java index e217de1540..b9ae8d10ff 100644 --- a/core/src/main/java/bisq/core/btc/setup/WalletsSetup.java +++ b/core/src/main/java/bisq/core/btc/setup/WalletsSetup.java @@ -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); }