mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-15 18:00:24 -04:00
replace variations of btc with xmr in app resources
This commit is contained in:
parent
fe543e7c58
commit
222af4768b
62 changed files with 2077 additions and 2101 deletions
|
@ -29,15 +29,15 @@ import javax.inject.Named;
|
|||
import java.net.UnknownHostException;
|
||||
|
||||
/**
|
||||
* Provides Socks5Proxies for the bitcoin network and http requests
|
||||
* Provides Socks5Proxies for the monero network and http requests
|
||||
* <p/>
|
||||
* By default there is only used the haveno internal Tor proxy, which is used for the P2P network, Btc network
|
||||
* (if Tor for btc is enabled) and http requests (if Tor for http requests is enabled).
|
||||
* By default there is only used the haveno internal Tor proxy, which is used for the P2P network, xmr network
|
||||
* (if Tor for xmr is enabled) and http requests (if Tor for http requests is enabled).
|
||||
* If the user provides a socks5ProxyHttpAddress it will be used for http requests.
|
||||
* If the user provides a socks5ProxyBtcAddress, this will be used for the btc network.
|
||||
* If socks5ProxyBtcAddress is present but no socks5ProxyHttpAddress the socks5ProxyBtcAddress will be used for http
|
||||
* If the user provides a socks5ProxyXmrAddress, this will be used for the xmr network.
|
||||
* If socks5ProxyXmrAddress is present but no socks5ProxyHttpAddress the socks5ProxyXmrAddress will be used for http
|
||||
* requests.
|
||||
* If no socks5ProxyBtcAddress and no socks5ProxyHttpAddress is defined (default) we use socks5ProxyInternal.
|
||||
* If no socks5ProxyXmrAddress and no socks5ProxyHttpAddress is defined (default) we use socks5ProxyInternal.
|
||||
*/
|
||||
public class Socks5ProxyProvider {
|
||||
private static final Logger log = LoggerFactory.getLogger(Socks5ProxyProvider.class);
|
||||
|
@ -47,23 +47,23 @@ public class Socks5ProxyProvider {
|
|||
|
||||
// proxy used for btc network
|
||||
@Nullable
|
||||
private final Socks5Proxy socks5ProxyBtc;
|
||||
private final Socks5Proxy socks5ProxyXmr;
|
||||
|
||||
// if defined proxy used for http requests
|
||||
@Nullable
|
||||
private final Socks5Proxy socks5ProxyHttp;
|
||||
|
||||
@Inject
|
||||
public Socks5ProxyProvider(@Named(Config.SOCKS_5_PROXY_BTC_ADDRESS) String socks5ProxyBtcAddress,
|
||||
public Socks5ProxyProvider(@Named(Config.SOCKS_5_PROXY_XMR_ADDRESS) String socks5ProxyXmrAddress,
|
||||
@Named(Config.SOCKS_5_PROXY_HTTP_ADDRESS) String socks5ProxyHttpAddress) {
|
||||
socks5ProxyBtc = getProxyFromAddress(socks5ProxyBtcAddress);
|
||||
socks5ProxyXmr = getProxyFromAddress(socks5ProxyXmrAddress);
|
||||
socks5ProxyHttp = getProxyFromAddress(socks5ProxyHttpAddress);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Socks5Proxy getSocks5Proxy() {
|
||||
if (socks5ProxyBtc != null)
|
||||
return socks5ProxyBtc;
|
||||
if (socks5ProxyXmr != null)
|
||||
return socks5ProxyXmr;
|
||||
else if (socks5ProxyInternalFactory != null)
|
||||
return getSocks5ProxyInternal();
|
||||
else
|
||||
|
@ -71,8 +71,8 @@ public class Socks5ProxyProvider {
|
|||
}
|
||||
|
||||
@Nullable
|
||||
public Socks5Proxy getSocks5ProxyBtc() {
|
||||
return socks5ProxyBtc;
|
||||
public Socks5Proxy getSocks5ProxyXmr() {
|
||||
return socks5ProxyXmr;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
|
|
@ -46,7 +46,7 @@ import static haveno.common.config.Config.BAN_LIST;
|
|||
import static haveno.common.config.Config.MAX_CONNECTIONS;
|
||||
import static haveno.common.config.Config.NODE_PORT;
|
||||
import static haveno.common.config.Config.REPUBLISH_MAILBOX_ENTRIES;
|
||||
import static haveno.common.config.Config.SOCKS_5_PROXY_BTC_ADDRESS;
|
||||
import static haveno.common.config.Config.SOCKS_5_PROXY_XMR_ADDRESS;
|
||||
import static haveno.common.config.Config.SOCKS_5_PROXY_HTTP_ADDRESS;
|
||||
import static haveno.common.config.Config.TORRC_FILE;
|
||||
import static haveno.common.config.Config.TORRC_OPTIONS;
|
||||
|
@ -92,7 +92,7 @@ public class P2PModule extends AppModule {
|
|||
bindConstant().annotatedWith(named(MAX_CONNECTIONS)).to(config.maxConnections);
|
||||
|
||||
bind(new TypeLiteral<List<String>>(){}).annotatedWith(named(BAN_LIST)).toInstance(config.banList);
|
||||
bindConstant().annotatedWith(named(SOCKS_5_PROXY_BTC_ADDRESS)).to(config.socks5ProxyBtcAddress);
|
||||
bindConstant().annotatedWith(named(SOCKS_5_PROXY_XMR_ADDRESS)).to(config.socks5ProxyXmrAddress);
|
||||
bindConstant().annotatedWith(named(SOCKS_5_PROXY_HTTP_ADDRESS)).to(config.socks5ProxyHttpAddress);
|
||||
bind(File.class).annotatedWith(named(TORRC_FILE)).toProvider(of(config.torrcFile)); // allow null value
|
||||
bindConstant().annotatedWith(named(TORRC_OPTIONS)).to(config.torrcOptions);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue