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

Function InferXOnlyPubkey

src/script/descriptor.cpp:2225–2234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2223}
2224
2225std::unique_ptr<PubkeyProvider> InferXOnlyPubkey(const XOnlyPubKey& xkey, ParseScriptContext ctx, const SigningProvider& provider)
2226{
2227 CPubKey pubkey{xkey.GetEvenCorrespondingCPubKey()};
2228 std::unique_ptr<PubkeyProvider> key_provider = std::make_unique<ConstPubkeyProvider>(0, pubkey, true);
2229 KeyOriginInfo info;
2230 if (provider.GetKeyOriginByXOnly(xkey, info)) {
2231 return std::make_unique<OriginPubkeyProvider>(0, std::move(info), std::move(key_provider), /*apostrophe=*/false);
2232 }
2233 return key_provider;
2234}
2235
2236/**
2237 * The context for parsing a Miniscript descriptor (either from Script or from its textual representation).

Callers 3

FromPKBytesMethod · 0.85
InferMultiAFunction · 0.85
InferScriptFunction · 0.85

Calls 2

GetKeyOriginByXOnlyMethod · 0.80

Tested by

no test coverage detected