MCPcopy Create free account
hub / github.com/ElementsProject/elements / InferXOnlyPubkey

Function InferXOnlyPubkey

src/script/descriptor.cpp:1247–1258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1245}
1246
1247std::unique_ptr<PubkeyProvider> InferXOnlyPubkey(const XOnlyPubKey& xkey, ParseScriptContext ctx, const SigningProvider& provider)
1248{
1249 unsigned char full_key[CPubKey::COMPRESSED_SIZE] = {0x02};
1250 std::copy(xkey.begin(), xkey.end(), full_key + 1);
1251 CPubKey pubkey(full_key);
1252 std::unique_ptr<PubkeyProvider> key_provider = std::make_unique<ConstPubkeyProvider>(0, pubkey, true);
1253 KeyOriginInfo info;
1254 if (provider.GetKeyOriginByXOnly(xkey, info)) {
1255 return std::make_unique<OriginPubkeyProvider>(0, std::move(info), std::move(key_provider));
1256 }
1257 return key_provider;
1258}
1259
1260std::unique_ptr<DescriptorImpl> InferScript(const CScript& script, ParseScriptContext ctx, const SigningProvider& provider)
1261{

Callers 1

InferScriptFunction · 0.85

Calls 3

GetKeyOriginByXOnlyMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected