diff options
| author | Pieter Wuille <[email protected]> | 2015-07-27 18:58:00 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2015-07-27 19:09:39 +0200 |
| commit | d741371d7d27e228aa64c618c50b23fb5449c3e1 (patch) | |
| tree | 0b292baaaabe5f9148db4813dad82c893dd04434 /src/bloom.h | |
| parent | Make CRollingBloomFilter set nTweak for you (diff) | |
| download | discoin-d741371d7d27e228aa64c618c50b23fb5449c3e1.tar.xz discoin-d741371d7d27e228aa64c618c50b23fb5449c3e1.zip | |
Only use randomly created nonces in CRollingBloomFilter.
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 12bf6d99a..a4dba8cb4 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; |