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

Method FromPKHBytes

src/script/descriptor.cpp:2309–2326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2307 }
2308
2309 template<typename I> std::optional<Key> FromPKHBytes(I begin, I end) const
2310 {
2311 assert(end - begin == 20);
2312 assert(m_in);
2313 uint160 hash;
2314 std::copy(begin, end, hash.begin());
2315 CKeyID keyid(hash);
2316 CPubKey pubkey;
2317 if (m_in->GetPubKey(keyid, pubkey)) {
2318 if (auto pubkey_provider = InferPubkey(pubkey, ParseContext(), *m_in)) {
2319 Key key = m_keys.size();
2320 m_keys.emplace_back();
2321 m_keys.back().push_back(std::move(pubkey_provider));
2322 return key;
2323 }
2324 }
2325 return {};
2326 }
2327
2328 miniscript::MiniscriptContext MsContext() const {
2329 return m_script_ctx;

Callers

nothing calls this directly

Calls 8

InferPubkeyFunction · 0.85
ParseContextEnum · 0.85
beginMethod · 0.45
GetPubKeyMethod · 0.45
sizeMethod · 0.45
emplace_backMethod · 0.45
push_backMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected