aboutsummaryrefslogtreecommitdiff
path: root/src/bloom.cpp
diff options
context:
space:
mode:
authorRobert McLaughlin <robert@sparkk.us>2016-11-01 21:04:26 -0400
committerRobert McLaughlin <robert@sparkk.us>2016-11-01 21:04:26 -0400
commitcccf73db0483cc3945bf8389ce197df35e931e16 (patch)
treeea9a5ac879568d2d8969b75ed9618f6b59a0aa08 /src/bloom.cpp
parent273bde37d867d1f6ab67e22a65097b7adfc4831a (diff)
downloadbitcoin-cccf73db0483cc3945bf8389ce197df35e931e16.tar.xz
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 2677652ada..d00befc61c 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)