use of bisq.core.btc.ProxySocketFactory in project bisq-core by bisq-network.
the class WalletConfig method createPeerGroup.
private PeerGroup createPeerGroup() {
// no proxy case.
if (socks5Proxy == null) {
return new PeerGroup(params, vChain);
} else {
// proxy case (tor).
Proxy proxy = new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(socks5Proxy.getInetAddress().getHostName(), socks5Proxy.getPort()));
ProxySocketFactory proxySocketFactory = new ProxySocketFactory(proxy);
// we dont use tor mode if we have a local node running
BlockingClientManager blockingClientManager = bisqEnvironment.isBitcoinLocalhostNodeRunning() ? new BlockingClientManager() : new BlockingClientManager(proxySocketFactory);
PeerGroup peerGroup = new PeerGroup(params, vChain, blockingClientManager);
blockingClientManager.setConnectTimeoutMillis(TIMEOUT);
peerGroup.setConnectTimeoutMillis(TIMEOUT);
return peerGroup;
}
}
Aggregations