From d741371d7d27e228aa64c618c50b23fb5449c3e1 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 27 Jul 2015 18:58:00 +0200 Subject: Only use randomly created nonces in CRollingBloomFilter. --- src/bloom.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/bloom.h') 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& vKey); void insert(const uint256& hash); bool contains(const std::vector& vKey) const; bool contains(const uint256& hash) const; - void reset(unsigned int nNewTweak = 0); + void reset(); private: unsigned int nBloomSize; -- cgit v1.2.3