5 #ifndef BITCOIN_COMMON_BLOOM_H 6 #define BITCOIN_COMMON_BLOOM_H 47 std::vector<unsigned char>
vData;
52 unsigned int Hash(
unsigned int nHashNum, std::span<const unsigned char> vDataToHash)
const;
64 CBloomFilter(
unsigned int nElements,
double nFPRate,
unsigned int nTweak,
unsigned char nFlagsIn);
69 void insert(std::span<const unsigned char> vKey);
72 bool contains(std::span<const unsigned char> vKey)
const;
113 void insert(std::span<const unsigned char> vKey);
114 bool contains(std::span<const unsigned char> vKey)
const;
127 #endif // BITCOIN_COMMON_BLOOM_H bloomflags
First two bits of nFlags control how much IsRelevantAndUpdate actually updates The remaining bits are...
bool IsRelevantAndUpdate(const CTransaction &tx)
Also adds any outputs which match the filter to the filter (to match their spending txes) ...
BloomFilter is a probabilistic filter which SPV clients provide so that we can filter the transaction...
static constexpr unsigned int MAX_HASH_FUNCS
RollingBloomFilter is a probabilistic "keep track of most recently inserted" set. ...
bool contains(std::span< const unsigned char > vKey) const
std::vector< unsigned char > vData
SERIALIZE_METHODS(CBloomFilter, obj)
static constexpr unsigned int MAX_BLOOM_FILTER_SIZE
20,000 items with fp rate < 0.1% or 10,000 items and <0.0001%
CRollingBloomFilter(unsigned int nElements, double nFPRate)
An outpoint - a combination of a transaction hash and an index n into its vout.
std::vector< uint64_t > data
int nEntriesThisGeneration
void insert(std::span< const unsigned char > vKey)
unsigned int Hash(unsigned int nHashNum, std::span< const unsigned char > vDataToHash) const
bool contains(std::span< const unsigned char > vKey) const
void insert(std::span< const unsigned char > vKey)
The basic transaction that is broadcasted on the network and contained in blocks. ...
bool IsWithinSizeConstraints() const
True if the size is <= MAX_BLOOM_FILTER_SIZE and the number of hash functions is <= MAX_HASH_FUNCS (c...
int nEntriesPerGeneration