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

Function Parse

src/script/descriptor.cpp:2954–2969  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2952}
2953
2954std::vector<std::unique_ptr<Descriptor>> Parse(std::string_view descriptor, FlatSigningProvider& out, std::string& error, bool require_checksum)
2955{
2956 std::span<const char> sp{descriptor};
2957 if (!CheckChecksum(sp, require_checksum, error)) return {};
2958 uint32_t key_exp_index = 0;
2959 auto ret = ParseScript(key_exp_index, sp, ParseScriptContext::TOP, out, error);
2960 if (sp.empty() && !ret.empty()) {
2961 std::vector<std::unique_ptr<Descriptor>> descs;
2962 descs.reserve(ret.size());
2963 for (auto& r : ret) {
2964 descs.emplace_back(std::unique_ptr<Descriptor>(std::move(r)));
2965 }
2966 return descs;
2967 }
2968 return {};
2969}
2970
2971std::string GetDescriptorChecksum(const std::string& descriptor)
2972{

Callers

nothing calls this directly

Calls 6

CheckChecksumFunction · 0.85
ParseScriptFunction · 0.70
emptyMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected