3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 14:54:15 +00:00

Add PeerGroup.clearListeners(). Resolves issue 426.

This commit is contained in:
Mike Hearn 2013-07-11 16:34:57 +02:00
parent 4e95ab3cfc
commit 2c26f8802b

View File

@ -450,6 +450,14 @@ public class PeerGroup extends AbstractIdleService implements TransactionBroadca
return ListenerRegistration.removeFromList(listener, peerEventListeners);
}
/**
* Removes all event listeners simultaneously. Note that this includes listeners added internally by the framework
* so it's generally not advised to use this - it exists for special purposes only.
*/
public void clearEventListeners() {
peerEventListeners.clear();
}
/**
* Returns a newly allocated list containing the currently connected peers. If all you care about is the count,
* use numConnectedPeers().