Merge pull request #3434 from lusarz/refactor-bisq-environment-5

Refactor BisqEnvironment - change type of ignoreLocalBtcNode to boolean
This commit is contained in:
Florian Reimair 2019-11-04 13:37:25 +01:00 committed by GitHub
commit 415aa105fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

View File

@ -195,7 +195,10 @@ public class BisqEnvironment extends StandardEnvironment {
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;
@ -264,7 +267,7 @@ public class BisqEnvironment extends StandardEnvironment {
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();
@ -344,10 +347,6 @@ public class BisqEnvironment extends StandardEnvironment {
}
}
public boolean getIgnoreLocalBtcNode() {
return ignoreLocalBtcNode.equalsIgnoreCase("true");
}
private Resource getAppDirPropertiesResource() {
String location = String.format("file:%s/bisq.properties", appDataDir);
return resourceLoader.getResource(location);
@ -429,7 +428,7 @@ public class BisqEnvironment extends StandardEnvironment {
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);

View File

@ -466,7 +466,7 @@ public class BisqSetup {
// For DAO testnet we ignore local btc node
if (BisqEnvironment.getBaseCurrencyNetwork().isDaoRegTest() ||
BisqEnvironment.getBaseCurrencyNetwork().isDaoTestNet() ||
bisqEnvironment.getIgnoreLocalBtcNode()) {
bisqEnvironment.isIgnoreLocalBtcNode()) {
step3();
} else {
new Thread(() -> {