Changeset View
Changeset View
Standalone View
Standalone View
src/bloom.h
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | public: | ||||
* added to the seed value passed to the hash function. It should generally | * added to the seed value passed to the hash function. It should generally | ||||
* always be a random value (and is largely only exposed for unit testing) | * always be a random value (and is largely only exposed for unit testing) | ||||
* nFlags should be one of the BLOOM_UPDATE_* enums (not _MASK) | * nFlags should be one of the BLOOM_UPDATE_* enums (not _MASK) | ||||
*/ | */ | ||||
CBloomFilter(const uint32_t nElements, const double nFPRate, | CBloomFilter(const uint32_t nElements, const double nFPRate, | ||||
const uint32_t nTweak, uint8_t nFlagsIn); | const uint32_t nTweak, uint8_t nFlagsIn); | ||||
CBloomFilter() : nHashFuncs(0), nTweak(0), nFlags(0) {} | CBloomFilter() : nHashFuncs(0), nTweak(0), nFlags(0) {} | ||||
ADD_SERIALIZE_METHODS; | SERIALIZE_METHODS(CBloomFilter, obj) { | ||||
READWRITE(obj.vData, obj.nHashFuncs, obj.nTweak, obj.nFlags); | |||||
template <typename Stream, typename Operation> | |||||
inline void SerializationOp(Stream &s, Operation ser_action) { | |||||
READWRITE(vData); | |||||
READWRITE(nHashFuncs); | |||||
READWRITE(nTweak); | |||||
READWRITE(nFlags); | |||||
} | } | ||||
void insert(const std::vector<uint8_t> &vKey); | void insert(const std::vector<uint8_t> &vKey); | ||||
void insert(const COutPoint &outpoint); | void insert(const COutPoint &outpoint); | ||||
void insert(const uint256 &hash); | void insert(const uint256 &hash); | ||||
bool contains(const std::vector<uint8_t> &vKey) const; | bool contains(const std::vector<uint8_t> &vKey) const; | ||||
bool contains(const COutPoint &outpoint) const; | bool contains(const COutPoint &outpoint) const; | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |