18 if (position >= block.
vtx.size()) {
19 throw std::out_of_range(
"Position out of range");
25 if (position % 2 == 0) {
30 position = position / 2;
45 const size_t num_txs = block->vtx.size();
49 for (
size_t i = 0; i <
num_txs; ++i) {
50 tx_hashes.push_back(block->vtx[i]->GetHash().ToUint256());
68 if (!block->vtx.empty()){
std::vector< CTransactionRef > vtx
T ConsumeIntegralInRange(T min, T max)
uint256 ComputeMerkleRoot(std::vector< uint256 > hashes, bool *mutated)
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
std::vector< uint256 > TransactionMerklePath(const CBlock &block, uint32_t position)
Compute merkle path to the specified transaction.
uint256 BlockWitnessMerkleRoot(const CBlock &block)
uint256 Hash(const T &in1)
Compute the 256-bit hash of an object.
static constexpr TransactionSerParams TX_NO_WITNESS
static constexpr TransactionSerParams TX_WITH_WITNESS
uint256 ComputeMerkleRootFromPath(const CBlock &block, uint32_t position, const std::vector< uint256 > &merkle_path)
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
FuzzedDataProvider & fuzzed_data_provider