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

Function InferMultiA

src/script/descriptor.cpp:2758–2771  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2756}
2757
2758std::unique_ptr<DescriptorImpl> InferMultiA(const CScript& script, ParseScriptContext ctx, const SigningProvider& provider)
2759{
2760 auto match = MatchMultiA(script);
2761 if (!match) return {};
2762 std::vector<std::unique_ptr<PubkeyProvider>> keys;
2763 keys.reserve(match->second.size());
2764 for (const auto keyspan : match->second) {
2765 if (keyspan.size() != 32) return {};
2766 auto key = InferXOnlyPubkey(XOnlyPubKey{keyspan}, ctx, provider);
2767 if (!key) return {};
2768 keys.push_back(std::move(key));
2769 }
2770 return std::make_unique<MultiADescriptor>(match->first, std::move(keys));
2771}
2772
2773// NOLINTNEXTLINE(misc-no-recursion)
2774std::unique_ptr<DescriptorImpl> InferScript(const CScript& script, ParseScriptContext ctx, const SigningProvider& provider)

Callers 1

InferScriptFunction · 0.85

Calls 5

MatchMultiAFunction · 0.85
InferXOnlyPubkeyFunction · 0.85
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected