Changeset View
Changeset View
Standalone View
Standalone View
src/bloom.cpp
Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | bool CBloomFilter::contains(const COutPoint &outpoint) const { | ||||
return contains(data); | return contains(data); | ||||
} | } | ||||
bool CBloomFilter::contains(const uint256 &hash) const { | bool CBloomFilter::contains(const uint256 &hash) const { | ||||
std::vector<uint8_t> data(hash.begin(), hash.end()); | std::vector<uint8_t> data(hash.begin(), hash.end()); | ||||
return contains(data); | return contains(data); | ||||
} | } | ||||
void CBloomFilter::clear() { | |||||
vData.assign(vData.size(), 0); | |||||
isFull = false; | |||||
isEmpty = true; | |||||
} | |||||
void CBloomFilter::reset(const uint32_t nNewTweak) { | |||||
clear(); | |||||
nTweak = nNewTweak; | |||||
} | |||||
bool CBloomFilter::IsWithinSizeConstraints() const { | bool CBloomFilter::IsWithinSizeConstraints() const { | ||||
return vData.size() <= MAX_BLOOM_FILTER_SIZE && | return vData.size() <= MAX_BLOOM_FILTER_SIZE && | ||||
nHashFuncs <= MAX_HASH_FUNCS; | nHashFuncs <= MAX_HASH_FUNCS; | ||||
} | } | ||||
bool CBloomFilter::MatchAndInsertOutputs(const CTransaction &tx) { | bool CBloomFilter::MatchAndInsertOutputs(const CTransaction &tx) { | ||||
bool fFound = false; | bool fFound = false; | ||||
// Match if the filter contains the hash of tx for finding tx when they | // Match if the filter contains the hash of tx for finding tx when they | ||||
▲ Show 20 Lines • Show All 203 Lines • Show Last 20 Lines |