Skip to content

Commit

Permalink
PeerGroup.triggerConnectionsJob code clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarguindzberg committed Apr 1, 2019
1 parent a1ed4be commit f36a1ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/bitcoinj/core/PeerGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ public void go() {
// BitcoinJ gets too many connections after a connection loss and reconnect as it adds up a lot of
// potential candidates and then try to connect to all of those when getting connection again.
// A check for maxConnections is required to not exceed connections.
if(pendingPeers.size() + peers.size() < maxConnections)
if (countConnectedAndPendingPeers() < getMaxConnections())
connectTo(addrToTry, false, vConnectTimeoutMillis);
} finally {
lock.unlock();
Expand Down

0 comments on commit f36a1ea

Please sign in to comment.