| 47 | } |
| 48 | |
| 49 | void CBloomFilter::insert(Span<const unsigned char> vKey) |
| 50 | { |
| 51 | if (vData.empty()) // Avoid divide-by-zero (CVE-2013-5700) |
| 52 | return; |
| 53 | for (unsigned int i = 0; i < nHashFuncs; i++) |
| 54 | { |
| 55 | unsigned int nIndex = Hash(i, vKey); |
| 56 | // Sets bit nIndex of vData |
| 57 | vData[nIndex >> 3] |= (1 << (7 & nIndex)); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | void CBloomFilter::insert(const COutPoint& outpoint) |
| 62 | { |