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

Method MakeScripts

src/script/descriptor.cpp:765–779  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

763{
764protected:
765 std::vector<CScript> MakeScripts(const std::vector<CPubKey>& keys, Span<const CScript>, FlatSigningProvider& out) const override
766 {
767 std::vector<CScript> ret;
768 CKeyID id = keys[0].GetID();
769 out.pubkeys.emplace(id, keys[0]);
770 ret.emplace_back(GetScriptForRawPubKey(keys[0])); // P2PK
771 ret.emplace_back(GetScriptForDestination(PKHash(id))); // P2PKH
772 if (keys[0].IsCompressed()) {
773 CScript p2wpkh = GetScriptForDestination(WitnessV0KeyHash(id));
774 out.scripts.emplace(CScriptID(p2wpkh), p2wpkh);
775 ret.emplace_back(p2wpkh);
776 ret.emplace_back(GetScriptForDestination(ScriptHash(p2wpkh))); // P2SH-P2WPKH
777 }
778 return ret;
779 }
780public:
781 ComboDescriptor(std::unique_ptr<PubkeyProvider> prov) : DescriptorImpl(Vector(std::move(prov)), "combo") {}
782 bool IsSingleType() const final { return false; }

Callers

nothing calls this directly

Calls 9

GetScriptForRawPubKeyFunction · 0.85
GetScriptForDestinationFunction · 0.85
PKHashClass · 0.85
WitnessV0KeyHashClass · 0.85
CScriptIDClass · 0.85
ScriptHashClass · 0.85
emplace_backMethod · 0.80
GetIDMethod · 0.45
IsCompressedMethod · 0.45

Tested by

no test coverage detected