Exemplo n.º 1
0
hash_digest generate_merkle_root(const message::transaction_list& transactions)
{
    hash_list tx_hashes;
    for (message::transaction tx: transactions)
        tx_hashes.push_back(hash_transaction(tx));
    return build_merkle_tree(tx_hashes);
}
Exemplo n.º 2
0
hash_digest generate_merkle_root(const transaction_list& transactions)
{
    // Generate list of transaction hashes.
    hash_list tx_hashes;
    for (transaction_type tx: transactions)
        tx_hashes.push_back(hash_transaction(tx));
    // Build merkle tree.
    return build_merkle_tree(tx_hashes);
}
Exemplo n.º 3
0
hash_digest block::generate_merkle_root(const transaction::list& transactions)
{
    // Generate list of transaction hashes.
    hash_list tx_hashes;
    for (const auto& tx: transactions)
        tx_hashes.push_back(tx.hash());

    // Build merkle tree.
    return build_merkle_tree(tx_hashes);
}