Skip to content

Commit

Permalink
Merge pull request #4154 from freimair/prevent_misuse_of_dev_cmdline_…
Browse files Browse the repository at this point in the history
…option

Limit abuse of `--useLocalhostForP2P` option
  • Loading branch information
ripcurlx authored Apr 10, 2020
2 parents e4d975e + 609b8b0 commit aeda234
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions common/src/main/java/bisq/common/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@ public Config(String defaultAppName, File defaultUserDataDir, String... args) {
.describedAs("host:port[,...]");

ArgumentAcceptingOptionSpec<Boolean> useLocalhostForP2POpt =
parser.accepts(USE_LOCALHOST_FOR_P2P, "Use localhost P2P network for development")
parser.accepts(USE_LOCALHOST_FOR_P2P, "Use localhost P2P network for development. Only available for non-BTC_MAINNET configuration.")
.availableIf(BASE_CURRENCY_NETWORK)
.withRequiredArg()
.ofType(boolean.class)
.defaultsTo(false);
Expand Down Expand Up @@ -687,7 +688,7 @@ public Config(String defaultAppName, File defaultUserDataDir, String... args) {
this.providers = options.valuesOf(providersOpt);
this.seedNodes = options.valuesOf(seedNodesOpt);
this.banList = options.valuesOf(banListOpt);
this.useLocalhostForP2P = options.valueOf(useLocalhostForP2POpt);
this.useLocalhostForP2P = this.baseCurrencyNetwork.isMainnet() ? false : options.valueOf(useLocalhostForP2POpt);
this.maxConnections = options.valueOf(maxConnectionsOpt);
this.socks5ProxyBtcAddress = options.valueOf(socks5ProxyBtcAddressOpt);
this.socks5ProxyHttpAddress = options.valueOf(socks5ProxyHttpAddressOpt);
Expand Down

0 comments on commit aeda234

Please sign in to comment.