Skip to content

Commit

Permalink
Move connection check to calling method (fix inverted logic)
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfredKarrer committed Jun 16, 2016
1 parent 093d5e4 commit cbac863
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 @@ -540,7 +540,7 @@ public void go() {
// 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.
// TODO: Review
if(pendingPeers.size() + peers.size() >= maxConnections)
if(pendingPeers.size() + peers.size() < maxConnections)
connectTo(addrToTry, false, vConnectTimeoutMillis);
} finally {
lock.unlock();
Expand Down

0 comments on commit cbac863

Please sign in to comment.