MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / Expand

Method Expand

src/script/descriptor.cpp:343–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341 return true;
342 }
343 bool Expand(int pos, const SigningProvider& arg, std::vector<CScript>& output_scripts, FlatSigningProvider& out) const override
344 {
345 CPubKey key;
346 if (!m_provider->GetPubKey(pos, arg, key)) return false;
347 CKeyID keyid = key.GetID();
348 {
349 CScript p2pk = GetScriptForRawPubKey(key);
350 CScript p2pkh = GetScriptForDestination(keyid);
351 output_scripts = std::vector<CScript>{std::move(p2pk), std::move(p2pkh)};
352 out.pubkeys.emplace(keyid, key);
353 }
354 if (key.IsCompressed()) {
355 CScript p2wpkh = GetScriptForDestination(WitnessV0KeyHash(keyid));
356 CScriptID p2wpkh_id(p2wpkh);
357 CScript p2sh_p2wpkh = GetScriptForDestination(p2wpkh_id);
358 out.scripts.emplace(p2wpkh_id, p2wpkh);
359 output_scripts.push_back(std::move(p2wpkh));
360 output_scripts.push_back(std::move(p2sh_p2wpkh));
361 }
362 return true;
363 }
364};
365
366////////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 7

GetScriptForRawPubKeyFunction · 0.85
GetScriptForDestinationFunction · 0.85
WitnessV0KeyHashClass · 0.85
GetIDMethod · 0.80
GetPubKeyMethod · 0.45
IsCompressedMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected