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

Method FromPKBytes

src/test/fuzz/miniscript.cpp:165–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163
164 template<typename I>
165 std::optional<Key> FromPKBytes(I first, I last) const {
166 if (!miniscript::IsTapscript(script_ctx)) {
167 Key key{first, last};
168 if (key.IsValid()) return key;
169 return {};
170 }
171 if (last - first != 32) return {};
172 XOnlyPubKey xonly_pubkey;
173 std::copy(first, last, xonly_pubkey.begin());
174 return xonly_pubkey.GetEvenCorrespondingCPubKey();
175 }
176
177 template<typename I>
178 std::optional<Key> FromPKHBytes(I first, I last) const {

Callers

nothing calls this directly

Calls 4

IsTapscriptFunction · 0.85
IsValidMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected