Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hash changes: remove unused GetType #47

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/blockfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
#include <util/golombrice.h>
#include <util/string.h>

/// SerType used to serialize parameters in GCS filter encoding.
static constexpr int GCS_SER_TYPE = SER_NETWORK;

/// Protocol version used to serialize parameters in GCS filter encoding.
static constexpr int GCS_SER_VERSION = 0;

Expand Down Expand Up @@ -52,7 +49,7 @@ GCSFilter::GCSFilter(const Params& params)
GCSFilter::GCSFilter(const Params& params, std::vector<unsigned char> encoded_filter, bool skip_decode_check)
: m_params(params), m_encoded(std::move(encoded_filter))
{
SpanReader stream{GCS_SER_TYPE, GCS_SER_VERSION, m_encoded};
SpanReader stream{GCS_SER_VERSION, m_encoded};

uint64_t N = ReadCompactSize(stream);
m_N = static_cast<uint32_t>(N);
Expand Down Expand Up @@ -84,7 +81,7 @@ GCSFilter::GCSFilter(const Params& params, const ElementSet& elements)
}
m_F = static_cast<uint64_t>(m_N) * static_cast<uint64_t>(m_params.m_M);

CVectorWriter stream(GCS_SER_TYPE, GCS_SER_VERSION, m_encoded, 0);
CVectorWriter stream(GCS_SER_VERSION, m_encoded, 0);

WriteCompactSize(stream, m_N);

Expand All @@ -106,7 +103,7 @@ GCSFilter::GCSFilter(const Params& params, const ElementSet& elements)

bool GCSFilter::MatchInternal(const uint64_t* element_hashes, size_t size) const
{
SpanReader stream{GCS_SER_TYPE, GCS_SER_VERSION, m_encoded};
SpanReader stream{GCS_SER_VERSION, m_encoded};

// Seek forward by size of N
uint64_t N = ReadCompactSize(stream);
Expand Down
Loading
Loading