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