Bitcoin Core  0.18.99
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)
 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
 
const GCSFilterGetFilter () const
 
const std::vector< unsigned char > & 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
 
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 109 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 
)

Reconstruct a BlockFilter from parts.

Definition at line 282 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 293 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 303 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 328 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 130 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 133 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 131 of file blockfilter.h.

◆ GetFilterType()

BlockFilterType BlockFilter::GetFilterType ( ) const
inline

Definition at line 129 of file blockfilter.h.

Here is the caller graph for this function:

◆ GetHash()

uint256 BlockFilter::GetHash ( ) const

Compute the filter hash.

Definition at line 319 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 145 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 152 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 113 of file blockfilter.h.

◆ m_filter

GCSFilter BlockFilter::m_filter
private

Definition at line 114 of file blockfilter.h.

◆ m_filter_type

BlockFilterType BlockFilter::m_filter_type = BlockFilterType::INVALID
private

Definition at line 112 of file blockfilter.h.


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