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

Method LearnRelatedScripts

src/wallet/scriptpubkeyman.cpp:1459–1469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1457}
1458
1459void LegacyScriptPubKeyMan::LearnRelatedScripts(const CPubKey& key, OutputType type)
1460{
1461 assert(type != OutputType::BECH32M);
1462 if (key.IsCompressed() && (type == OutputType::P2SH_SEGWIT || type == OutputType::BECH32)) {
1463 CTxDestination witdest = WitnessV0KeyHash(key.GetID());
1464 CScript witprog = GetScriptForDestination(witdest);
1465 // Make sure the resulting program is solvable.
1466 assert(IsSolvable(*this, witprog));
1467 AddCScript(witprog);
1468 }
1469}
1470
1471void LegacyScriptPubKeyMan::LearnAllRelatedScripts(const CPubKey& key)
1472{

Callers

nothing calls this directly

Calls 5

WitnessV0KeyHashClass · 0.85
GetScriptForDestinationFunction · 0.85
IsSolvableFunction · 0.85
IsCompressedMethod · 0.45
GetIDMethod · 0.45

Tested by

no test coverage detected