recursive function that traverses tree nodes, consuming the bits and hashes produced by TraverseAndBuild. it returns the hash of the respective node and its respective index.

Synopsis

Declared in <merkleblock.h>

uint256
TraverseAndExtract(
    int height,
    unsigned int pos,
    unsigned int& nBitsUsed,
    unsigned int& nHashUsed,
    std::vector<Txid>& vMatch,
    std::vector<unsigned int>& vnIndex);

Return Value

The hash of the current node.

Parameters

Name

Description

height

The tree level of the current node, counted from the leaf level (height 0) upward.

pos

The position of the current node within its level.

nBitsUsed

Running count of flag bits consumed so far; advanced as bits are read.

nHashUsed

Running count of hashes consumed so far; advanced as hashes are read.

vMatch

Output list of matched transaction ids collected during traversal.

vnIndex

Output list of the indices of the matched transactions within the tree.

Created with MrDocs