3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 06:44:16 +00:00

Make PeerGroup.addAddress adjust the number of requested connections.

This commit is contained in:
Mike Hearn 2013-01-10 14:12:05 +01:00
parent dd9e0d5d0d
commit 43e8752ef8

View File

@ -405,7 +405,12 @@ public class PeerGroup extends AbstractIdleService {
* @param peerAddress IP/port to use.
*/
public void addAddress(PeerAddress peerAddress) {
inactives.add(peerAddress);
int newMax;
synchronized (this) {
inactives.add(peerAddress);
newMax = getMaxConnections() + 1;
}
setMaxConnections(newMax);
}
/**