Skip to content

Commit

Permalink
[indexes] Fix default [de]serialization of BlockFilter.
Browse files Browse the repository at this point in the history
This only changes network serialization. Disk serialization is defined
in ReadFilterFromDisk() and WriteFilterToDisk() and does not include the
filter_type.

Github-Pull: bitcoin#18876
Rebased-From: 5335fa8
  • Loading branch information
jimpo authored and luke-jr committed May 14, 2020
1 parent ecfc1e3 commit eb91f28
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/blockfilter.h
Expand Up @@ -144,8 +144,8 @@ class BlockFilter

template <typename Stream>
void Serialize(Stream& s) const {
s << m_block_hash
<< static_cast<uint8_t>(m_filter_type)
s << static_cast<uint8_t>(m_filter_type)
<< m_block_hash
<< m_filter.GetEncoded();
}

Expand All @@ -154,8 +154,8 @@ class BlockFilter
std::vector<unsigned char> encoded_filter;
uint8_t filter_type;

s >> m_block_hash
>> filter_type
s >> filter_type
>> m_block_hash
>> encoded_filter;

m_filter_type = static_cast<BlockFilterType>(filter_type);
Expand Down

0 comments on commit eb91f28

Please sign in to comment.