mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-15 03:35:52 +00:00
PeerGroup: fix a bug that'd leave maxConnections == 0 if setRequiredServices was used without configuring any other discovery (a typical use case).
This commit is contained in:
parent
fabbb0a9ac
commit
0079c272ff
@ -831,14 +831,14 @@ public class PeerGroup implements TransactionBroadcaster {
|
||||
/**
|
||||
* Convenience for connecting only to peers that can serve specific services. It will configure suitable peer
|
||||
* discoveries.
|
||||
* @param services Required services as a bitmask, e.g. {@link VersionMessage#NODE_NETWORK}.
|
||||
* @param requiredServices Required services as a bitmask, e.g. {@link VersionMessage#NODE_NETWORK}.
|
||||
*/
|
||||
public void setRequiredServices(long requiredServices) {
|
||||
lock.lock();
|
||||
try {
|
||||
this.requiredServices = requiredServices;
|
||||
peerDiscoverers.clear();
|
||||
peerDiscoverers.add(MultiplexingDiscovery.forServices(params, requiredServices));
|
||||
addPeerDiscovery(MultiplexingDiscovery.forServices(params, requiredServices));
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user