Bitcoin
Public Member Functions | Public Attributes | Private Member Functions | List of all members
CMerkleBlock Class Reference

#include <merkleblock.h>

Public Member Functions

 CMerkleBlock (const CBlock &block, CBloomFilter &filter)
 
 CMerkleBlock (const CBlock &block, const std::set< uint256 > &txids)
 
 CMerkleBlock ()
 
template<typename Stream , typename Operation >
void SerializationOp (Stream &s, Operation ser_action)
 

Public Attributes

CBlockHeader header
 
CPartialMerkleTree txn
 
std::vector< std::pair< unsigned int, uint256 > > vMatchedTxn
 
 ADD_SERIALIZE_METHODS
 

Private Member Functions

 CMerkleBlock (const CBlock &block, CBloomFilter *filter, const std::set< uint256 > *txids)
 

Detailed Description

Used to relay blocks as header + vector<merkle branch> to filtered nodes.

NOTE: The class assumes that the given CBlock has at least 1 transaction. If the CBlock has 0 txs, it will hit an assertion.

Constructor & Destructor Documentation

◆ CMerkleBlock() [1/4]

CMerkleBlock::CMerkleBlock ( const CBlock block,
CBloomFilter filter 
)
inline

Create from a CBlock, filtering transactions according to filter Note that this will call IsRelevantAndUpdate on the filter for each transaction, thus the filter will likely be modified.

◆ CMerkleBlock() [2/4]

CMerkleBlock::CMerkleBlock ( const CBlock block,
const std::set< uint256 > &  txids 
)
inline

◆ CMerkleBlock() [3/4]

CMerkleBlock::CMerkleBlock ( )
inline

◆ CMerkleBlock() [4/4]

CMerkleBlock::CMerkleBlock ( const CBlock block,
CBloomFilter filter,
const std::set< uint256 > *  txids 
)
private

Member Function Documentation

◆ SerializationOp()

template<typename Stream , typename Operation >
void CMerkleBlock::SerializationOp ( Stream &  s,
Operation  ser_action 
)
inline

Member Data Documentation

◆ ADD_SERIALIZE_METHODS

CMerkleBlock::ADD_SERIALIZE_METHODS

◆ header

CBlockHeader CMerkleBlock::header

Public only for unit testing

◆ txn

CPartialMerkleTree CMerkleBlock::txn

◆ vMatchedTxn

std::vector<std::pair<unsigned int, uint256> > CMerkleBlock::vMatchedTxn

Public only for unit testing and relay testing (not relayed).

Used only when a bloom filter is specified to allow testing the transactions which matched the bloom filter.


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