Bitcoin ABC 0.30.7
P2P Digital Currency
|
Used to create a Merkle proof (usually from a subset of transactions), which consists of a block header and partial Merkle Tree. More...
#include <merkleblock.h>
Public Member Functions | |
CMerkleBlock (const CBlock &block, CBloomFilter &filter) | |
Create a Merkle proof according to a bloom filter. More... | |
CMerkleBlock (const CBlock &block, const std::set< TxId > &txids) | |
Create a Merkle proof for a set of transactions. More... | |
CMerkleBlock () | |
SERIALIZE_METHODS (CMerkleBlock, obj) | |
Public Attributes | |
CBlockHeader | header |
Public only for unit testing. More... | |
CPartialMerkleTree | txn |
std::vector< std::pair< size_t, uint256 > > | vMatchedTxn |
Public only for unit testing and relay testing (not relayed). More... | |
Private Member Functions | |
CMerkleBlock (const CBlock &block, CBloomFilter *filter, const std::set< TxId > *txids) | |
Combined constructor to consolidate code. More... | |
Used to create a Merkle proof (usually from a subset of transactions), which consists of a block header and partial Merkle Tree.
SPV clients typically use this Merkle proof to limit bandwidth and computation requirements to process incoming transactions. From the peer-node's perspective, the SPV client is a "filtered node". See BIP37 for details: https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki
NOTE: The class assumes that the given CBlock has at least 1 transaction. If the CBlock has 0 txs, it will hit an assertion.
Definition at line 147 of file merkleblock.h.
|
inline |
Create a Merkle proof according to a bloom filter.
Note that this will call IsRelevantAndUpdate on the filter for each transaction, thus the filter will likely be modified.
Definition at line 166 of file merkleblock.h.
Create a Merkle proof for a set of transactions.
Definition at line 172 of file merkleblock.h.
|
inline |
Definition at line 175 of file merkleblock.h.
|
private |
Combined constructor to consolidate code.
At most one of filter or txids may be provided.
Definition at line 27 of file merkleblock.cpp.
|
inline |
Definition at line 177 of file merkleblock.h.
CBlockHeader CMerkleBlock::header |
Public only for unit testing.
Definition at line 150 of file merkleblock.h.
CPartialMerkleTree CMerkleBlock::txn |
Definition at line 151 of file merkleblock.h.
std::vector<std::pair<size_t, 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.
Definition at line 159 of file merkleblock.h.