diff options
| author | Robert McLaughlin <[email protected]> | 2016-11-01 21:04:26 -0400 |
|---|---|---|
| committer | Robert McLaughlin <[email protected]> | 2016-11-01 21:04:26 -0400 |
| commit | cccf73db0483cc3945bf8389ce197df35e931e16 (patch) | |
| tree | ea9a5ac879568d2d8969b75ed9618f6b59a0aa08 | |
| parent | Merge #9043: [qt] Return useful error message on ATMP failure (diff) | |
| download | discoin-cccf73db0483cc3945bf8389ce197df35e931e16.tar.xz discoin-cccf73db0483cc3945bf8389ce197df35e931e16.zip | |
trivial: fix bloom filter init to isEmpty = true
Fixes newly initialized bloom filters being
constructed with isEmpty(false), which still
works but loses the possible speedup when
checking for key membership in an empty filter.
| -rw-r--r-- | src/bloom.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bloom.cpp b/src/bloom.cpp index 2677652ad..d00befc61 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -34,7 +34,7 @@ CBloomFilter::CBloomFilter(unsigned int nElements, double nFPRate, unsigned int * See https://en.wikipedia.org/wiki/Bloom_filter for an explanation of these formulas */ isFull(false), - isEmpty(false), + isEmpty(true), nHashFuncs(min((unsigned int)(vData.size() * 8 / nElements * LN2), MAX_HASH_FUNCS)), nTweak(nTweakIn), nFlags(nFlagsIn) |