Bitcoin Core  27.99.0
P2P Digital Currency
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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. More...
 
 BlockFilter (BlockFilterType filter_type, const CBlock &block, const CBlockUndo &block_undo)
 Construct a new BlockFilter of the specified type from a block. More...
 
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. More...
 
uint256 ComputeHeader (const uint256 &prev_header) const
 Compute the filter header given the previous one. More...
 
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 114 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 207 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 218 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 228 of file blockfilter.cpp.

Here is the call graph for this function:
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 249 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 135 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 138 of file blockfilter.h.

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

◆ GetFilter()

const GCSFilter& BlockFilter::GetFilter ( ) const
inline

Definition at line 136 of file blockfilter.h.

Here is the caller graph for this function:

◆ GetFilterType()

BlockFilterType BlockFilter::GetFilterType ( ) const
inline

Definition at line 134 of file blockfilter.h.

Here is the caller graph for this function:

◆ GetHash()

uint256 BlockFilter::GetHash ( ) const

Compute the filter hash.

Definition at line 244 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 150 of file blockfilter.h.

Here is the call graph for this function:

◆ Unserialize()

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

Definition at line 157 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 118 of file blockfilter.h.

◆ m_filter

GCSFilter BlockFilter::m_filter
private

Definition at line 119 of file blockfilter.h.

◆ m_filter_type

BlockFilterType BlockFilter::m_filter_type = BlockFilterType::INVALID
private

Definition at line 117 of file blockfilter.h.


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