Bitcoin ABC  0.26.3
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 BlockHash &block_hash, std::vector< uint8_t > filter)
 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 BlockHashGetBlockHash () const
 
const GCSFilterGetFilter () const
 
const std::vector< uint8_t > & GetEncodedFilter () const
 
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
 
BlockHash 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 111 of file blockfilter.h.

Constructor & Destructor Documentation

◆ BlockFilter() [1/3]

BlockFilter::BlockFilter ( )
default

◆ BlockFilter() [2/3]

BlockFilter::BlockFilter ( BlockFilterType  filter_type,
const BlockHash block_hash,
std::vector< uint8_t >  filter 
)

Reconstruct a BlockFilter from parts.

Definition at line 220 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 231 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 241 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 264 of file blockfilter.cpp.

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

◆ GetBlockHash()

const BlockHash& BlockFilter::GetBlockHash ( ) const
inline

Definition at line 131 of file blockfilter.h.

Here is the caller graph for this function:

◆ GetEncodedFilter()

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

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

◆ GetFilterType()

BlockFilterType BlockFilter::GetFilterType ( ) const
inline

Definition at line 130 of file blockfilter.h.

Here is the caller graph for this function:

◆ GetHash()

uint256 BlockFilter::GetHash ( ) const

Compute the filter hash.

Definition at line 256 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 144 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 149 of file blockfilter.h.

Here is the call graph for this function:

Member Data Documentation

◆ m_block_hash

BlockHash BlockFilter::m_block_hash
private

Definition at line 114 of file blockfilter.h.

◆ m_filter

GCSFilter BlockFilter::m_filter
private

Definition at line 115 of file blockfilter.h.

◆ m_filter_type

BlockFilterType BlockFilter::m_filter_type = BlockFilterType::INVALID
private

Definition at line 113 of file blockfilter.h.


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