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

Method LearnRelatedScripts

src/wallet/wallet.cpp:4433–4442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4431}
4432
4433void CWallet::LearnRelatedScripts(const CPubKey& key, OutputType type)
4434{
4435 if (key.IsCompressed() && (type == OutputType::P2SH_SEGWIT || type == OutputType::BECH32)) {
4436 CTxDestination witdest = WitnessV0KeyHash(key.GetID());
4437 CScript witprog = GetScriptForDestination(witdest);
4438 // Make sure the resulting program is solvable.
4439 assert(IsSolvable(*this, witprog));
4440 AddCScript(witprog);
4441 }
4442}
4443
4444void CWallet::LearnAllRelatedScripts(const CPubKey& key)
4445{

Callers 3

getnewaddressFunction · 0.80
getrawchangeaddressFunction · 0.80
learnRelatedScriptsMethod · 0.80

Calls 5

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

Tested by

no test coverage detected