Update logging indicating number of btc nodes

The logged message that indicates the number of btc nodes to connect to
was incorrect when only a single node is used in regtest mode.
This commit is contained in:
Devin Bileck 2019-01-30 15:24:00 -08:00
parent 53cf14791f
commit ba466d40ee
No known key found for this signature in database
GPG Key ID: 38750B26EA8B8C93

View File

@ -446,8 +446,9 @@ public class WalletConfig extends AbstractIdleService {
// before we're actually connected the broadcast waits for an appropriate number of connections.
if (peerAddresses != null) {
for (PeerAddress addr : peerAddresses) vPeerGroup.addAddress(addr);
log.info("We try to connect to {} btc nodes", numConnectionForBtc);
vPeerGroup.setMaxConnections(Math.min(numConnectionForBtc, peerAddresses.length));
int maxConnections = Math.min(numConnectionForBtc, peerAddresses.length);
log.info("We try to connect to {} btc nodes", maxConnections);
vPeerGroup.setMaxConnections(maxConnections);
peerAddresses = null;
} else if (!params.equals(RegTestParams.get())) {
vPeerGroup.addPeerDiscovery(discovery != null ? discovery : new DnsDiscovery(params));