| 83 | } |
| 84 | |
| 85 | bool CBloomFilter::contains(const std::vector<unsigned char>& vKey) const |
| 86 | { |
| 87 | if (isFull) |
| 88 | return true; |
| 89 | if (isEmpty) |
| 90 | return false; |
| 91 | for (unsigned int i = 0; i < nHashFuncs; i++) |
| 92 | { |
| 93 | unsigned int nIndex = Hash(i, vKey); |
| 94 | // Checks bit nIndex of vData |
| 95 | if (!(vData[nIndex >> 3] & (1 << (7 & nIndex)))) |
| 96 | return false; |
| 97 | } |
| 98 | return true; |
| 99 | } |
| 100 | |
| 101 | bool CBloomFilter::contains(const COutPoint& outpoint) const |
| 102 | { |