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

Method MakeScripts

src/script/descriptor.cpp:1505–1520  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1503 std::vector<int> m_depths;
1504protected:
1505 std::vector<CScript> MakeScripts(const std::vector<CPubKey>& keys, std::span<const CScript> scripts, FlatSigningProvider& out) const override
1506 {
1507 TaprootBuilder builder;
1508 assert(m_depths.size() == scripts.size());
1509 for (size_t pos = 0; pos < m_depths.size(); ++pos) {
1510 builder.Add(m_depths[pos], scripts[pos], TAPROOT_LEAF_TAPSCRIPT);
1511 }
1512 if (!builder.IsComplete()) return {};
1513 assert(keys.size() == 1);
1514 XOnlyPubKey xpk(keys[0]);
1515 if (!xpk.IsFullyValid()) return {};
1516 builder.Finalize(xpk);
1517 WitnessV1Taproot output = builder.GetOutput();
1518 out.tr_trees[output] = builder;
1519 return Vector(GetScriptForDestination(output));
1520 }
1521 bool ToStringSubScriptHelper(const SigningProvider* arg, std::string& ret, const StringType type, const DescriptorCache* cache = nullptr) const override
1522 {
1523 if (m_depths.empty()) {

Callers

nothing calls this directly

Calls 8

VectorFunction · 0.85
GetScriptForDestinationFunction · 0.85
IsCompleteMethod · 0.80
IsFullyValidMethod · 0.80
sizeMethod · 0.45
AddMethod · 0.45
FinalizeMethod · 0.45
GetOutputMethod · 0.45

Tested by

no test coverage detected