Struct bitcoin_merkle::MerkleBlock
source · pub struct MerkleBlock {
pub header: BlockHeader,
pub txn: PartialMerkleTree,
pub matched_txn: Vec<(u32, u256)>,
}Expand 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. |
Fields§
§header: BlockHeader| Public only for unit testing |
txn: PartialMerkleTree§matched_txn: Vec<(u32, u256)>| 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. |
Implementations§
source§impl MerkleBlock
impl MerkleBlock
sourcepub fn new_with_block_and_filter(
block: Amo<Block>,
filter: &mut BloomFilter
) -> Self
pub fn new_with_block_and_filter( block: Amo<Block>, filter: &mut BloomFilter ) -> Self
| Create from a Block, filtering transactions | according to filter | | ———– | @note | | this will call IsRelevantAndUpdate | on the filter for each transaction, | thus the filter will likely be modified. |
sourcepub fn new_with_block_and_txids(block: &Block, txids: &HashSet<u256>) -> Self
pub fn new_with_block_and_txids(block: &Block, txids: &HashSet<u256>) -> Self
| Create from a Block, matching the txids | in the set |
sourcepub fn new_with_block_filter_and_txids(
block: &Block,
filter: *mut BloomFilter,
txids: *const HashSet<u256>
) -> Self
pub fn new_with_block_filter_and_txids( block: &Block, filter: *mut BloomFilter, txids: *const HashSet<u256> ) -> Self
| Combined constructor to consolidate | code |