aboutsummaryrefslogtreecommitdiff
path: root/src/bloom.cpp
diff options
context:
space:
mode:
authorRobert McLaughlin <[email protected]>2016-11-01 21:04:26 -0400
committerRobert McLaughlin <[email protected]>2016-11-01 21:04:26 -0400
commitcccf73db0483cc3945bf8389ce197df35e931e16 (patch)
treeea9a5ac879568d2d8969b75ed9618f6b59a0aa08 /src/bloom.cpp
parentMerge #9043: [qt] Return useful error message on ATMP failure (diff)
downloaddiscoin-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.
Diffstat (limited to 'src/bloom.cpp')
-rw-r--r--src/bloom.cpp2
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)