diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2015-07-27 18:58:00 +0200 |
---|---|---|
committer | Peter Todd <pete@petertodd.org> | 2015-10-02 12:17:49 +0200 |
commit | 6eed52e05b697547105e7f6ab2419a3b1bf50189 (patch) | |
tree | 215f498f2b7df398974a424c7e613cd08d820642 /src/bloom.h | |
parent | 83671efe996f6ea695d051594acc7f5fb4c500fc (diff) |
Only use randomly created nonces in CRollingBloomFilter.
(cherry picked from commit d741371d7d27e228aa64c618c50b23fb5449c3e1)
Diffstat (limited to 'src/bloom.h')
-rw-r--r-- | src/bloom.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bloom.h b/src/bloom.h index 12bf6d99a8..a4dba8cb4f 100644 --- a/src/bloom.h +++ b/src/bloom.h @@ -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; |