Only use randomly created nonces in CRollingBloomFilter.

(cherry picked from commit d741371d7d27e228aa64c618c50b23fb5449c3e1)
This commit is contained in:
Pieter Wuille
2015-07-27 18:58:00 +02:00
committed by Peter Todd
parent 83671efe99
commit 6eed52e05b
3 changed files with 14 additions and 13 deletions

View File

@@ -116,15 +116,17 @@ public:
class CRollingBloomFilter
{
public:
CRollingBloomFilter(unsigned int nElements, double nFPRate,
unsigned int nTweak = 0);
// A random bloom filter calls GetRand() at creation time.
// Don't create global CRollingBloomFilter objects, as they may be
// constructed before the randomizer is properly initialized.
CRollingBloomFilter(unsigned int nElements, double nFPRate);
void insert(const std::vector<unsigned char>& vKey);
void insert(const uint256& hash);
bool contains(const std::vector<unsigned char>& vKey) const;
bool contains(const uint256& hash) const;
void reset(unsigned int nNewTweak = 0);
void reset();
private:
unsigned int nBloomSize;