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 3e88fd63951..a68ed53414f 100644 --- a/core/src/main/java/bisq/core/btc/setup/WalletConfig.java +++ b/core/src/main/java/bisq/core/btc/setup/WalletConfig.java @@ -446,8 +446,9 @@ protected void startUp() throws Exception { // before we're actually connected the broadcast waits for an appropriate number of connections. if (peerAddresses != null) { for (PeerAddress addr : peerAddresses) vPeerGroup.addAddress(addr); - log.info("We try to connect to {} btc nodes", numConnectionForBtc); - vPeerGroup.setMaxConnections(Math.min(numConnectionForBtc, peerAddresses.length)); + int maxConnections = Math.min(numConnectionForBtc, peerAddresses.length); + log.info("We try to connect to {} btc nodes", maxConnections); + vPeerGroup.setMaxConnections(maxConnections); peerAddresses = null; } else if (!params.equals(RegTestParams.get())) { vPeerGroup.addPeerDiscovery(discovery != null ? discovery : new DnsDiscovery(params)); 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 936c617625a..c329cc662ab 100644 --- a/core/src/main/java/bisq/core/btc/setup/WalletsSetup.java +++ b/core/src/main/java/bisq/core/btc/setup/WalletsSetup.java @@ -236,7 +236,6 @@ protected void onSetupCompleted() { if (regTestHost == RegTestHost.LOCALHOST) { walletConfig.setPeerNodesForLocalHost(); } else if (regTestHost == RegTestHost.REMOTE_HOST) { - walletConfig.setMinBroadcastConnections(1); configPeerNodesForRegTestServer(); } else { configPeerNodes(socks5Proxy); @@ -315,7 +314,11 @@ private int evaluateMode(String socks5DiscoverModeString) { private void configPeerNodesForRegTestServer() { try { - walletConfig.setPeerNodes(new PeerAddress(InetAddress.getByName(RegTestHost.HOST), params.getPort())); + if (RegTestHost.HOST.endsWith(".onion")) { + walletConfig.setPeerNodes(new PeerAddress(RegTestHost.HOST, params.getPort())); + } else { + walletConfig.setPeerNodes(new PeerAddress(InetAddress.getByName(RegTestHost.HOST), params.getPort())); + } } catch (UnknownHostException e) { log.error(e.toString()); e.printStackTrace(); diff --git a/core/src/main/java/bisq/core/user/Preferences.java b/core/src/main/java/bisq/core/user/Preferences.java index 04e7d378830..b2f442b176a 100644 --- a/core/src/main/java/bisq/core/user/Preferences.java +++ b/core/src/main/java/bisq/core/user/Preferences.java @@ -692,10 +692,12 @@ public boolean showAgain(String key) { } public boolean getUseTorForBitcoinJ() { - // We override the useTorForBitcoinJ and set it to false if we detected a localhost node or if we are not on mainnet. - // At testnet there are very few Bitcoin tor nodes and we don't provide tor nodes. - if (!BisqEnvironment.getBaseCurrencyNetwork().isMainnet() + // We override the useTorForBitcoinJ and set it to false if we detected a localhost node or if we are not on mainnet, + // unless the useTorForBtc parameter is explicitly provided. + // On testnet there are very few Bitcoin tor nodes and we don't provide tor nodes. + if ((!BisqEnvironment.getBaseCurrencyNetwork().isMainnet() || bisqEnvironment.isBitcoinLocalhostNodeRunning()) + && (useTorFlagFromOptions == null || useTorFlagFromOptions.isEmpty())) return false; else return prefPayload.isUseTorForBitcoinJ();