MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / GetTreeTuples

Method GetTreeTuples

src/script/signingprovider.cpp:636–650  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

634}
635
636std::vector<std::tuple<uint8_t, uint8_t, std::vector<unsigned char>>> TaprootBuilder::GetTreeTuples() const
637{
638 assert(IsComplete());
639 std::vector<std::tuple<uint8_t, uint8_t, std::vector<unsigned char>>> tuples;
640 if (m_branch.size()) {
641 const auto& leaves = m_branch[0]->leaves;
642 for (const auto& leaf : leaves) {
643 assert(leaf.merkle_branch.size() <= TAPROOT_CONTROL_MAX_NODE_COUNT);
644 uint8_t depth = (uint8_t)leaf.merkle_branch.size();
645 uint8_t leaf_ver = (uint8_t)leaf.leaf_version;
646 tuples.emplace_back(depth, leaf_ver, leaf.script);
647 }
648 }
649 return tuples;
650}

Callers 2

FromSignatureDataMethod · 0.80
operator==Method · 0.80

Calls 2

sizeMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected