Merge pull request #3783 from ripcurlx/only-connect-to-localhost-when-detected

Not allow bitcoinj to auto connect to localhost when localhost was not detected by client
This commit is contained in:
sqrrm 2019-12-16 15:03:38 +01:00 committed by GitHub
commit 65d3dd3c93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -216,8 +216,6 @@ public class WalletConfig extends AbstractIdleService {
// no proxy case.
if (socks5Proxy == null) {
peerGroup = new PeerGroup(params, vChain);
// For dao testnet (server side regtest) we prevent to connect to a localhost node to avoid confusion
// if local btc node is not synced with our dao testnet master node.
} else {
// proxy case (tor).
Proxy proxy = new Proxy(Proxy.Type.SOCKS,
@ -238,7 +236,9 @@ public class WalletConfig extends AbstractIdleService {
// For dao testnet (server side regtest) we prevent to connect to a localhost node to avoid confusion
// if local btc node is not synced with our dao testnet master node.
if (BisqEnvironment.getBaseCurrencyNetwork().isDaoRegTest() || BisqEnvironment.getBaseCurrencyNetwork().isDaoTestNet())
if (BisqEnvironment.getBaseCurrencyNetwork().isDaoRegTest() ||
BisqEnvironment.getBaseCurrencyNetwork().isDaoTestNet() ||
!bisqEnvironment.isBitcoinLocalhostNodeRunning())
peerGroup.setUseLocalhostPeerWhenPossible(false);
return peerGroup;