public interface PeerFilterProvider
PeerGroup.recalculateFastCatchupAndFilter(PeerGroup.FilterRecalculateMode)
whenever a change occurs which
effects the data provided via this interface.Modifier and Type | Method and Description |
---|---|
void |
beginBloomFilterCalculation()
Called on all registered filter providers before
getBloomFilterElementCount() and
getBloomFilter(int, double, long) are called. |
void |
endBloomFilterCalculation()
|
BloomFilter |
getBloomFilter(int size,
double falsePositiveRate,
long nTweak)
Gets a bloom filter that contains all the necessary elements for the listener to receive relevant transactions.
|
int |
getBloomFilterElementCount()
Gets the number of elements that will be added to a bloom filter returned by
getBloomFilter(int, double, long) |
long |
getEarliestKeyCreationTime()
Returns the earliest timestamp (seconds since epoch) for which full/bloom-filtered blocks must be downloaded.
|
long getEarliestKeyCreationTime()
0
requires that all
blocks be downloaded, and thus this should default to System.currentTimeMillis()
/1000.void beginBloomFilterCalculation()
getBloomFilterElementCount()
and
getBloomFilter(int, double, long)
are called. Once called, the provider should ensure that the items
it will want to insert into the filter don't change. The reason is that all providers will have their element
counts queried, and then a filter big enough for all of them will be specified. So the provider must use
consistent state. There is guaranteed to be a matching call to endBloomFilterCalculation()
that can
be used to e.g. unlock a lock.int getBloomFilterElementCount()
getBloomFilter(int, double, long)
BloomFilter getBloomFilter(int size, double falsePositiveRate, long nTweak)
void endBloomFilterCalculation()