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

Function ParseDeriveType

src/script/descriptor.cpp:1923–1935  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1921}
1922
1923static DeriveType ParseDeriveType(std::vector<std::span<const char>>& split, bool& apostrophe)
1924{
1925 DeriveType type = DeriveType::NON_RANGED;
1926 if (std::ranges::equal(split.back(), std::span{"*"}.first(1))) {
1927 split.pop_back();
1928 type = DeriveType::UNHARDENED_RANGED;
1929 } else if (std::ranges::equal(split.back(), std::span{"*'"}.first(2)) || std::ranges::equal(split.back(), std::span{"*h"}.first(2))) {
1930 apostrophe = std::ranges::equal(split.back(), std::span{"*'"}.first(2));
1931 split.pop_back();
1932 type = DeriveType::HARDENED_RANGED;
1933 }
1934 return type;
1935}
1936
1937/** Parse a public key that excludes origin information. */
1938std::vector<std::unique_ptr<PubkeyProvider>> ParsePubkeyInner(uint32_t& key_exp_index, const std::span<const char>& sp, ParseScriptContext ctx, FlatSigningProvider& out, bool& apostrophe, std::string& error)

Callers 2

ParsePubkeyInnerFunction · 0.85
ParsePubkeyFunction · 0.85

Calls 2

backMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected