Package org.bitcoinj.core
Interface PeerFilterProvider
-
- All Known Implementing Classes:
Wallet
public interface PeerFilterProvider
An interface which provides the information required to properly filter data downloaded from Peers. Note that an implementer is responsible for callingPeerGroup.recalculateFastCatchupAndFilter(PeerGroup.FilterRecalculateMode)
whenever a change occurs which effects the data provided via this interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
beginBloomFilterCalculation()
Called on all registered filter providers beforegetBloomFilterElementCount()
andgetBloomFilter(int, double, int)
are called.java.time.Instant
earliestKeyCreationTime()
Returns the earliest time for which full/bloom-filtered blocks must be downloaded.void
endBloomFilterCalculation()
BloomFilter
getBloomFilter(int size, double falsePositiveRate, int 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 bygetBloomFilter(int, double, int)
default long
getEarliestKeyCreationTime()
Deprecated.
-
-
-
Method Detail
-
earliestKeyCreationTime
java.time.Instant earliestKeyCreationTime()
Returns the earliest time for which full/bloom-filtered blocks must be downloaded. Blocks with timestamps before this time will only have headers downloaded.Instant.EPOCH
requires that all blocks be downloaded, and thus this should default toInstant.MAX
.
-
getEarliestKeyCreationTime
@Deprecated default long getEarliestKeyCreationTime()
Deprecated.
-
beginBloomFilterCalculation
void beginBloomFilterCalculation()
Called on all registered filter providers beforegetBloomFilterElementCount()
andgetBloomFilter(int, double, int)
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 toendBloomFilterCalculation()
that can be used to e.g. unlock a lock.
-
getBloomFilterElementCount
int getBloomFilterElementCount()
Gets the number of elements that will be added to a bloom filter returned bygetBloomFilter(int, double, int)
-
getBloomFilter
BloomFilter getBloomFilter(int size, double falsePositiveRate, int nTweak)
Gets a bloom filter that contains all the necessary elements for the listener to receive relevant transactions. Default value should be an empty bloom filter with the given size, falsePositiveRate, and nTweak.
-
endBloomFilterCalculation
void endBloomFilterCalculation()
-
-