From d38da59bf68fbb37535e2579bfb7355a16baed0e Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 9 Jun 2014 10:02:00 +0200 Subject: Code simplifications after CTransaction::GetHash() caching --- src/bloom.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/bloom.cpp') diff --git a/src/bloom.cpp b/src/bloom.cpp index 1bfcbd406..26e366179 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -99,7 +99,7 @@ bool CBloomFilter::IsWithinSizeConstraints() const return vData.size() <= MAX_BLOOM_FILTER_SIZE && nHashFuncs <= MAX_HASH_FUNCS; } -bool CBloomFilter::IsRelevantAndUpdate(const CTransaction& tx, const uint256& hash) +bool CBloomFilter::IsRelevantAndUpdate(const CTransaction& tx) { bool fFound = false; // Match if the filter contains the hash of tx @@ -108,6 +108,7 @@ bool CBloomFilter::IsRelevantAndUpdate(const CTransaction& tx, const uint256& ha return true; if (isEmpty) return false; + const uint256& hash = tx.GetHash(); if (contains(hash)) fFound = true; -- cgit v1.2.3 From 8fbf03995df9a2003be603be1a930bc3373d56e0 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Wed, 25 Jun 2014 16:21:29 -0700 Subject: CBloomFilter::clear() method --- src/bloom.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/bloom.cpp') diff --git a/src/bloom.cpp b/src/bloom.cpp index 26e366179..85a2ddc18 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -94,6 +94,13 @@ bool CBloomFilter::contains(const uint256& hash) const return contains(data); } +void CBloomFilter::clear() +{ + vData.assign(vData.size(),0); + isFull = false; + isEmpty = true; +} + bool CBloomFilter::IsWithinSizeConstraints() const { return vData.size() <= MAX_BLOOM_FILTER_SIZE && nHashFuncs <= MAX_HASH_FUNCS; -- cgit v1.2.3