Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor BisqEnvironment - change type of ignoreLocalBtcNode to boolean #3434

Merged
merged 1 commit into from
Nov 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions core/src/main/java/bisq/core/app/BisqEnvironment.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,10 @@ public static boolean isDaoActivated(Environment environment) {
banList, dumpStatistics, maxMemory, socks5ProxyBtcAddress,
torRcFile, torRcOptions, externalTorControlPort, externalTorPassword, externalTorCookieFile,
socks5ProxyHttpAddress, useAllProvidedNodes, numConnectionForBtc, genesisTxId, genesisBlockHeight, genesisTotalSupply,
referralId, daoActivated, msgThrottlePerSec, msgThrottlePer10Sec, sendMsgThrottleTrigger, sendMsgThrottleSleep, ignoreLocalBtcNode;
referralId, daoActivated, msgThrottlePerSec, msgThrottlePer10Sec, sendMsgThrottleTrigger, sendMsgThrottleSleep;

@Getter
protected boolean ignoreLocalBtcNode;

protected final boolean externalTorUseSafeCookieAuthentication, torStreamIsolation;

Expand Down Expand Up @@ -264,7 +267,7 @@ public BisqEnvironment(PropertySource commandLineProperties) {
userAgent = getProperty(commandLineProperties, BtcOptionKeys.USER_AGENT, "Bisq");
useAllProvidedNodes = getProperty(commandLineProperties, BtcOptionKeys.USE_ALL_PROVIDED_NODES, "false");
numConnectionForBtc = getProperty(commandLineProperties, BtcOptionKeys.NUM_CONNECTIONS_FOR_BTC, "9");
ignoreLocalBtcNode = getProperty(commandLineProperties, BtcOptionKeys.IGNORE_LOCAL_BTC_NODE, "false");
ignoreLocalBtcNode = getProperty(commandLineProperties, BtcOptionKeys.IGNORE_LOCAL_BTC_NODE, "false").equalsIgnoreCase("true");


MutablePropertySources propertySources = getPropertySources();
Expand Down Expand Up @@ -344,10 +347,6 @@ protected void setProperty(String key, String value) {
}
}

public boolean getIgnoreLocalBtcNode() {
return ignoreLocalBtcNode.equalsIgnoreCase("true");
}

private Resource getAppDirPropertiesResource() {
String location = String.format("file:%s/bisq.properties", appDataDir);
return resourceLoader.getResource(location);
Expand Down Expand Up @@ -429,7 +428,7 @@ private PropertySource<?> defaultProperties() {
setProperty(BtcOptionKeys.USER_AGENT, userAgent);
setProperty(BtcOptionKeys.USE_ALL_PROVIDED_NODES, useAllProvidedNodes);
setProperty(BtcOptionKeys.NUM_CONNECTIONS_FOR_BTC, numConnectionForBtc);
setProperty(BtcOptionKeys.IGNORE_LOCAL_BTC_NODE, ignoreLocalBtcNode);
setProperty(BtcOptionKeys.IGNORE_LOCAL_BTC_NODE, String.valueOf(ignoreLocalBtcNode));

setProperty(UserAgent.NAME_KEY, appName);
setProperty(UserAgent.VERSION_KEY, Version.VERSION);
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/bisq/core/app/BisqSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ private void checkIfLocalHostNodeIsRunning() {
// For DAO testnet we ignore local btc node
if (BisqEnvironment.getBaseCurrencyNetwork().isDaoRegTest() ||
BisqEnvironment.getBaseCurrencyNetwork().isDaoTestNet() ||
bisqEnvironment.getIgnoreLocalBtcNode()) {
bisqEnvironment.isIgnoreLocalBtcNode()) {
step3();
} else {
new Thread(() -> {
Expand Down