Finish moving 'bitcoinRegtestHost' option handling to Config

This commit is contained in:
Chris Beams 2019-12-17 12:56:35 +01:00
parent be97190415
commit 769c62b7b3
No known key found for this signature in database
GPG Key ID: 3D214F8F5BC5ED73
5 changed files with 6 additions and 11 deletions

View File

@ -63,6 +63,7 @@ public class Config {
public static final int DEFAULT_INT = Integer.MIN_VALUE;
static final String DEFAULT_CONFIG_FILE_NAME = "bisq.properties";
public static final String DEFAULT_REGTEST_HOST = "localhost";
public static File CURRENT_APP_DATA_DIR;
@ -205,7 +206,7 @@ public class Config {
.withRequiredArg()
.ofType(String.class)
.describedAs("host[:port]")
.defaultsTo("localhost");
.defaultsTo("");
ArgumentAcceptingOptionSpec<Boolean> daoActivatedOpt =
parser.accepts("daoActivated", "Developer flag. If true it enables dao phase 2 features.")

View File

@ -18,7 +18,6 @@
package bisq.core.app;
import bisq.core.btc.BtcOptionKeys;
import bisq.core.btc.setup.RegTestHost;
import bisq.core.btc.setup.WalletsSetup;
import bisq.core.btc.wallet.BsqWalletService;
import bisq.core.btc.wallet.BtcWalletService;
@ -287,11 +286,6 @@ public abstract class BisqExecutable implements GracefulShutDownHandler, BisqSet
.ofType(boolean.class);
//BtcOptionKeys
parser.accepts(BtcOptionKeys.REG_TEST_HOST,
format("Bitcoin regtest host when using BTC_REGTEST network (default: %s)", RegTestHost.DEFAULT_HOST))
.withRequiredArg()
.describedAs("host");
parser.accepts(BtcOptionKeys.IGNORE_LOCAL_BTC_NODE,
"If set to true a Bitcoin core node running locally will be ignored")
.withRequiredArg();

View File

@ -66,7 +66,7 @@ public class BitcoinModule extends AppModule {
"104.248.31.39" :
config.getBaseCurrencyNetwork().isDaoRegTest() ?
"134.209.242.206" :
RegTestHost.DEFAULT_HOST;
Config.DEFAULT_REGTEST_HOST;
}
RegTestHost.HOST = regTestHost;

View File

@ -24,6 +24,5 @@ public class BtcOptionKeys {
public static final String USER_AGENT = "userAgent";
public static final String USE_ALL_PROVIDED_NODES = "useAllProvidedNodes"; // We only use onion nodes if tor is enabled. That flag overrides that default behavior.
public static final String NUM_CONNECTIONS_FOR_BTC = "numConnectionForBtc";
public static final String REG_TEST_HOST = "bitcoinRegtestHost";
public static final String IGNORE_LOCAL_BTC_NODE = "ignoreLocalBtcNode";
}

View File

@ -17,13 +17,14 @@
package bisq.core.btc.setup;
import bisq.common.config.Config;
public enum RegTestHost {
NONE,
LOCALHOST,
REMOTE_HOST;
public static final String DEFAULT_HOST = "localhost";
public static String HOST = DEFAULT_HOST;
public static String HOST = Config.DEFAULT_REGTEST_HOST;
}