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

Method MakeScripts

src/script/descriptor.cpp:1294–1307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1292{
1293protected:
1294 std::vector<CScript> MakeScripts(const std::vector<CPubKey>& keys, std::span<const CScript>, FlatSigningProvider& out) const override
1295 {
1296 std::vector<CScript> ret;
1297 CKeyID id = keys[0].GetID();
1298 ret.emplace_back(GetScriptForRawPubKey(keys[0])); // P2PK
1299 ret.emplace_back(GetScriptForDestination(PKHash(id))); // P2PKH
1300 if (keys[0].IsCompressed()) {
1301 CScript p2wpkh = GetScriptForDestination(WitnessV0KeyHash(id));
1302 out.scripts.emplace(CScriptID(p2wpkh), p2wpkh);
1303 ret.emplace_back(p2wpkh);
1304 ret.emplace_back(GetScriptForDestination(ScriptHash(p2wpkh))); // P2SH-P2WPKH
1305 }
1306 return ret;
1307 }
1308public:
1309 ComboDescriptor(std::unique_ptr<PubkeyProvider> prov) : DescriptorImpl(Vector(std::move(prov)), "combo") {}
1310 bool IsSingleType() const final { return false; }

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected