Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
CPartialMerkleTreeTester Class Reference
Inheritance diagram for CPartialMerkleTreeTester:
[legend]
Collaboration diagram for CPartialMerkleTreeTester:
[legend]

Public Member Functions

 CPartialMerkleTreeTester (FastRandomContext &rng)
void Damage ()
Public Member Functions inherited from CPartialMerkleTree
 SERIALIZE_METHODS (CPartialMerkleTree, obj)
 CPartialMerkleTree (const std::vector< Txid > &vTxid, const std::vector< bool > &vMatch)
 Construct a partial merkle tree from a list of transaction ids, and a mask that selects a subset of them.
 CPartialMerkleTree ()
uint256 ExtractMatches (std::vector< Txid > &vMatch, std::vector< unsigned int > &vnIndex)
 extract the matching txid's represented by this partial merkle tree and their respective indices within the partial tree.
unsigned int GetNumTransactions () const
 Get number of transactions the merkle proof is indicating for cross-reference with local blockchain knowledge.

Public Attributes

FastRandomContextm_rng

Additional Inherited Members

Protected Member Functions inherited from CPartialMerkleTree
unsigned int CalcTreeWidth (int height) const
 helper function to efficiently calculate the number of nodes at given height in the merkle tree
uint256 CalcHash (int height, unsigned int pos, const std::vector< Txid > &vTxid)
 calculate the hash of a node in the merkle tree (at leaf level: the txid's themselves)
void TraverseAndBuild (int height, unsigned int pos, const std::vector< Txid > &vTxid, const std::vector< bool > &vMatch)
 recursive function that traverses tree nodes, storing the data as bits and hashes
uint256 TraverseAndExtract (int height, unsigned int pos, unsigned int &nBitsUsed, unsigned int &nHashUsed, std::vector< Txid > &vMatch, std::vector< unsigned int > &vnIndex)
 recursive function that traverses tree nodes, consuming the bits and hashes produced by TraverseAndBuild.
Protected Attributes inherited from CPartialMerkleTree
unsigned int nTransactions
 the total number of transactions in the block
std::vector< bool > vBits
 node-is-parent-of-matched-txid bits
std::vector< uint256vHash
 txids and internal hashes
bool fBad
 flag set when encountering invalid data

Detailed Description

Definition at line 17 of file pmt_tests.cpp.

Constructor & Destructor Documentation

◆ CPartialMerkleTreeTester()

CPartialMerkleTreeTester::CPartialMerkleTreeTester ( FastRandomContext & rng)
inline

Definition at line 20 of file pmt_tests.cpp.

Member Function Documentation

◆ Damage()

void CPartialMerkleTreeTester::Damage ( )
inline

Definition at line 23 of file pmt_tests.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ m_rng

FastRandomContext& CPartialMerkleTreeTester::m_rng

Definition at line 29 of file pmt_tests.cpp.


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