Skip to content

Commit

Permalink
Revert "CBloomFilter::clear() method"
Browse files Browse the repository at this point in the history
This reverts commit 8fbf039.
  • Loading branch information
laanwj committed Jul 21, 2014
1 parent 98e84aa commit 8f3f94a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
7 changes: 0 additions & 7 deletions src/bloom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,6 @@ 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;
Expand Down
2 changes: 0 additions & 2 deletions src/bloom.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ class CBloomFilter
bool contains(const COutPoint& outpoint) const;
bool contains(const uint256& hash) const;

void clear();

// True if the size is <= MAX_BLOOM_FILTER_SIZE and the number of hash functions is <= MAX_HASH_FUNCS
// (catch a filter which was just deserialized which was too big)
bool IsWithinSizeConstraints() const;
Expand Down
4 changes: 0 additions & 4 deletions src/test/bloom_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ BOOST_AUTO_TEST_CASE(bloom_create_insert_serialize)
expected[i] = (char)vch[i];

BOOST_CHECK_EQUAL_COLLECTIONS(stream.begin(), stream.end(), expected.begin(), expected.end());

BOOST_CHECK_MESSAGE( filter.contains(ParseHex("99108ad8ed9bb6274d3980bab5a85c048f0950c8")), "BloomFilter doesn't contain just-inserted object!");
filter.clear();
BOOST_CHECK_MESSAGE( !filter.contains(ParseHex("99108ad8ed9bb6274d3980bab5a85c048f0950c8")), "BloomFilter should be empty!");
}

BOOST_AUTO_TEST_CASE(bloom_create_insert_serialize_with_tweak)
Expand Down

0 comments on commit 8f3f94a

Please sign in to comment.