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

Method FromPKBytes

src/script/descriptor.cpp:2286–2307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2284 }
2285
2286 template<typename I> std::optional<Key> FromPKBytes(I begin, I end) const
2287 {
2288 assert(m_in);
2289 Key key = m_keys.size();
2290 if (miniscript::IsTapscript(m_script_ctx) && end - begin == 32) {
2291 XOnlyPubKey pubkey;
2292 std::copy(begin, end, pubkey.begin());
2293 if (auto pubkey_provider = InferXOnlyPubkey(pubkey, ParseContext(), *m_in)) {
2294 m_keys.emplace_back();
2295 m_keys.back().push_back(std::move(pubkey_provider));
2296 return key;
2297 }
2298 } else if (!miniscript::IsTapscript(m_script_ctx)) {
2299 CPubKey pubkey(begin, end);
2300 if (auto pubkey_provider = InferPubkey(pubkey, ParseContext(), *m_in)) {
2301 m_keys.emplace_back();
2302 m_keys.back().push_back(std::move(pubkey_provider));
2303 return key;
2304 }
2305 }
2306 return {};
2307 }
2308
2309 template<typename I> std::optional<Key> FromPKHBytes(I begin, I end) const
2310 {

Callers

nothing calls this directly

Calls 9

IsTapscriptFunction · 0.85
InferXOnlyPubkeyFunction · 0.85
ParseContextEnum · 0.85
InferPubkeyFunction · 0.85
sizeMethod · 0.45
beginMethod · 0.45
emplace_backMethod · 0.45
push_backMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected