Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
BlockFilter Class Reference

Complete block filter struct as defined in BIP 157. More...

#include <blockfilter.h>

Collaboration diagram for BlockFilter:
[legend]

Public Member Functions

 BlockFilter ()=default
 BlockFilter (BlockFilterType filter_type, const uint256 &block_hash, std::vector< unsigned char > filter, bool skip_decode_check)
 Reconstruct a BlockFilter from parts.
 BlockFilter (BlockFilterType filter_type, const CBlock &block, const CBlockUndo &block_undo)
 Construct a new BlockFilter of the specified type from a block.
BlockFilterType GetFilterType () const
const uint256GetBlockHash () const LIFETIMEBOUND
const GCSFilterGetFilter () const LIFETIMEBOUND
const std::vector< unsigned char > & GetEncodedFilter () const LIFETIMEBOUND
uint256 GetHash () const
 Compute the filter hash.
uint256 ComputeHeader (const uint256 &prev_header) const
 Compute the filter header given the previous one.
template<typename Stream>
void Serialize (Stream &s) const
template<typename Stream>
void Unserialize (Stream &s)

Private Member Functions

bool BuildParams (GCSFilter::Params &params) const

Private Attributes

BlockFilterType m_filter_type = BlockFilterType::INVALID
uint256 m_block_hash
GCSFilter m_filter

Detailed Description

Complete block filter struct as defined in BIP 157.

Serialization matches payload of "cfilter" messages.

Definition at line 115 of file blockfilter.h.

Constructor & Destructor Documentation

◆ BlockFilter() [1/3]

BlockFilter::BlockFilter ( )
default

◆ BlockFilter() [2/3]

BlockFilter::BlockFilter ( BlockFilterType filter_type,
const uint256 & block_hash,
std::vector< unsigned char > filter,
bool skip_decode_check )

Reconstruct a BlockFilter from parts.

Definition at line 211 of file blockfilter.cpp.

Here is the call graph for this function:

◆ BlockFilter() [3/3]

BlockFilter::BlockFilter ( BlockFilterType filter_type,
const CBlock & block,
const CBlockUndo & block_undo )

Construct a new BlockFilter of the specified type from a block.

Definition at line 222 of file blockfilter.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ BuildParams()

bool BlockFilter::BuildParams ( GCSFilter::Params & params) const
private

Definition at line 232 of file blockfilter.cpp.

Here is the caller graph for this function:

◆ ComputeHeader()

uint256 BlockFilter::ComputeHeader ( const uint256 & prev_header) const

Compute the filter header given the previous one.

Definition at line 253 of file blockfilter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBlockHash()

const uint256 & BlockFilter::GetBlockHash ( ) const
inline

Definition at line 136 of file blockfilter.h.

Here is the caller graph for this function:

◆ GetEncodedFilter()

const std::vector< unsigned char > & BlockFilter::GetEncodedFilter ( ) const
inline

Definition at line 139 of file blockfilter.h.

Here is the caller graph for this function:

◆ GetFilter()

const GCSFilter & BlockFilter::GetFilter ( ) const
inline

Definition at line 137 of file blockfilter.h.

Here is the caller graph for this function:

◆ GetFilterType()

BlockFilterType BlockFilter::GetFilterType ( ) const
inline

Definition at line 135 of file blockfilter.h.

Here is the caller graph for this function:

◆ GetHash()

uint256 BlockFilter::GetHash ( ) const

Compute the filter hash.

Definition at line 248 of file blockfilter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Serialize()

template<typename Stream>
void BlockFilter::Serialize ( Stream & s) const
inline

Definition at line 151 of file blockfilter.h.

◆ Unserialize()

template<typename Stream>
void BlockFilter::Unserialize ( Stream & s)
inline

Definition at line 158 of file blockfilter.h.

Here is the call graph for this function:

Member Data Documentation

◆ m_block_hash

uint256 BlockFilter::m_block_hash
private

Definition at line 119 of file blockfilter.h.

◆ m_filter

GCSFilter BlockFilter::m_filter
private

Definition at line 120 of file blockfilter.h.

◆ m_filter_type

BlockFilterType BlockFilter::m_filter_type = BlockFilterType::INVALID
private

Definition at line 118 of file blockfilter.h.


The documentation for this class was generated from the following files: