| 31 | } |
| 32 | |
| 33 | void CBloomFilter::insert(const vector<uint8_t>& vKey) { |
| 34 | if (isFull) |
| 35 | return; |
| 36 | for (uint32_t i = 0; i < nHashFuncs; i++) { |
| 37 | uint32_t index = Hash(i, vKey); |
| 38 | // Sets bit index of vData |
| 39 | vData[index >> 3] |= (1 << (7 & index)); |
| 40 | } |
| 41 | isEmpty = false; |
| 42 | } |
| 43 | |
| 44 | void CBloomFilter::insert(const uint256& hash) { |
| 45 | vector<uint8_t> data(hash.begin(), hash.end()); |