 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file.
5 #ifndef BITCOIN_BLOOM_H
6 #define BITCOIN_BLOOM_H
17 static const unsigned int MAX_BLOOM_FILTER_SIZE = 36000;
18 static const unsigned int MAX_HASH_FUNCS = 50;
46 std::vector<unsigned char>
vData;
53 unsigned int Hash(
unsigned int nHashNum,
const std::vector<unsigned char>& vDataToHash)
const;
69 CBloomFilter(
unsigned int nElements,
double nFPRate,
unsigned int nTweak,
unsigned char nFlagsIn);
74 template <
typename Stream,
typename Operation>
75 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion)
83 void insert(
const std::vector<unsigned char>& vKey);
87 bool contains(
const std::vector<unsigned char>& vKey)
const;
92 void reset(
unsigned int nNewTweak);
124 void insert(
const std::vector<unsigned char>& vKey);
126 bool contains(
const std::vector<unsigned char>& vKey)
const;
137 #endif // BITCOIN_BLOOM_H
bool contains(const std::vector< unsigned char > &vKey) const
void reset(unsigned int nNewTweak)
void insert(const std::vector< unsigned char > &vKey)
bool IsWithinSizeConstraints() const
True if the size is <= MAX_BLOOM_FILTER_SIZE and the number of hash functions is <= MAX_HASH_FUNCS (c...
BloomFilter is a probabilistic filter which SPV clients provide so that we can filter the transaction...
@ BLOOM_UPDATE_P2PUBKEY_ONLY
unsigned int Hash(unsigned int nHashNum, const std::vector< unsigned char > &vDataToHash) const
std::vector< unsigned char > vData
void UpdateEmptyFull()
Checks for empty and full filters to avoid wasting cpu.
bool contains(const std::vector< unsigned char > &vKey) const
The basic transaction that is broadcasted on the network and contained in blocks.
CRollingBloomFilter(unsigned int nElements, double nFPRate)
void insert(const std::vector< unsigned char > &vKey)
256-bit unsigned big integer.
bloomflags
First two bits of nFlags control how much IsRelevantAndUpdate actually updates The remaining bits are...
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
An outpoint - a combination of a transaction hash and an index n into its vout.
bool IsRelevantAndUpdate(const CTransaction &tx)
Also adds any outputs which match the filter to the filter (to match their spending txes)
RollingBloomFilter is a probabilistic "keep track of most recently inserted" set.