3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-31 07:12:17 +00:00

PeerGroup: add a removePeerFilterProvider to complement add.

This commit is contained in:
Mike Hearn 2014-11-08 22:34:56 +01:00
parent b36169caba
commit 580a67c0b7

View File

@ -50,6 +50,7 @@ import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.locks.ReentrantLock;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
@ -931,6 +932,20 @@ public class PeerGroup extends AbstractExecutionThreadService implements Transac
}
}
/**
* Opposite of {@link #addPeerFilterProvider(PeerFilterProvider)}. Again, don't use this for wallets. Does not
* trigger recalculation of the filter.
*/
public void removePeerFilterProvider(PeerFilterProvider provider) {
lock.lock();
try {
checkNotNull(provider);
checkArgument(peerFilterProviders.remove(provider));
} finally {
lock.unlock();
}
}
/**
* Unlinks the given wallet so it no longer receives broadcast transactions or has its transactions announced.
*/