diff --git a/common/src/main/java/haveno/common/config/Config.java b/common/src/main/java/haveno/common/config/Config.java index 92359c76..897a795a 100644 --- a/common/src/main/java/haveno/common/config/Config.java +++ b/common/src/main/java/haveno/common/config/Config.java @@ -117,6 +117,7 @@ public class Config { public static final String BTC_FEE_INFO = "bitcoinFeeInfo"; public static final String BYPASS_MEMPOOL_VALIDATION = "bypassMempoolValidation"; public static final String PASSWORD_REQUIRED = "passwordRequired"; + public static final String UPDATE_XMR_BINARIES = "updateXmrBinaries"; // Default values for certain options public static final int UNSPECIFIED_PORT = -1; @@ -204,6 +205,7 @@ public class Config { public final boolean republishMailboxEntries; public final boolean bypassMempoolValidation; public final boolean passwordRequired; + public final boolean updateXmrBinaries; // Properties derived from options but not exposed as options themselves public final File torDir; @@ -621,6 +623,13 @@ public class Config { .ofType(boolean.class) .defaultsTo(false); + ArgumentAcceptingOptionSpec updateXmrBinariesOpt = + parser.accepts(UPDATE_XMR_BINARIES, + "Update Monero binaries if applicable") + .withRequiredArg() + .ofType(boolean.class) + .defaultsTo(true); + try { CompositeOptionSet options = new CompositeOptionSet(); @@ -733,6 +742,7 @@ public class Config { this.republishMailboxEntries = options.valueOf(republishMailboxEntriesOpt); this.bypassMempoolValidation = options.valueOf(bypassMempoolValidationOpt); this.passwordRequired = options.valueOf(passwordRequiredOpt); + this.updateXmrBinaries = options.valueOf(updateXmrBinariesOpt); } catch (OptionException ex) { throw new ConfigException("problem parsing option '%s': %s", ex.options().get(0), diff --git a/core/src/main/java/haveno/core/app/HavenoSetup.java b/core/src/main/java/haveno/core/app/HavenoSetup.java index a291da50..eee13f3e 100644 --- a/core/src/main/java/haveno/core/app/HavenoSetup.java +++ b/core/src/main/java/haveno/core/app/HavenoSetup.java @@ -369,7 +369,7 @@ public class HavenoSetup { // install monerod File monerodFile = new File(XmrLocalNode.MONEROD_PATH); String monerodResourcePath = "bin/" + XmrLocalNode.MONEROD_NAME; - if (!monerodFile.exists() || !FileUtil.resourceEqualToFile(monerodResourcePath, monerodFile)) { + if (!monerodFile.exists() || (config.updateXmrBinaries && !FileUtil.resourceEqualToFile(monerodResourcePath, monerodFile))) { log.info("Installing monerod"); monerodFile.getParentFile().mkdirs(); FileUtil.resourceToFile("bin/" + XmrLocalNode.MONEROD_NAME, monerodFile); @@ -379,7 +379,7 @@ public class HavenoSetup { // install monero-wallet-rpc File moneroWalletRpcFile = new File(XmrWalletService.MONERO_WALLET_RPC_PATH); String moneroWalletRpcResourcePath = "bin/" + XmrWalletService.MONERO_WALLET_RPC_NAME; - if (!moneroWalletRpcFile.exists() || !FileUtil.resourceEqualToFile(moneroWalletRpcResourcePath, moneroWalletRpcFile)) { + if (!moneroWalletRpcFile.exists() || (config.updateXmrBinaries && !FileUtil.resourceEqualToFile(moneroWalletRpcResourcePath, moneroWalletRpcFile))) { log.info("Installing monero-wallet-rpc"); moneroWalletRpcFile.getParentFile().mkdirs(); FileUtil.resourceToFile(moneroWalletRpcResourcePath, moneroWalletRpcFile);