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

Method MakeScripts

src/script/descriptor.cpp:715–723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

713 const bool m_xonly;
714protected:
715 std::vector<CScript> MakeScripts(const std::vector<CPubKey>& keys, Span<const CScript>, FlatSigningProvider&) const override
716 {
717 if (m_xonly) {
718 CScript script = CScript() << ToByteVector(XOnlyPubKey(keys[0])) << OP_CHECKSIG;
719 return Vector(std::move(script));
720 } else {
721 return Vector(GetScriptForRawPubKey(keys[0]));
722 }
723 }
724public:
725 PKDescriptor(std::unique_ptr<PubkeyProvider> prov, bool xonly = false) : DescriptorImpl(Vector(std::move(prov)), "pk"), m_xonly(xonly) {}
726 bool IsSingleType() const final { return true; }

Callers

nothing calls this directly

Calls 5

ToByteVectorFunction · 0.85
VectorFunction · 0.85
GetScriptForRawPubKeyFunction · 0.85
CScriptClass · 0.70
XOnlyPubKeyClass · 0.70

Tested by

no test coverage detected