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

Method GetMetadata

src/wallet/scriptpubkeyman.cpp:683–702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

681}
682
683std::unique_ptr<CKeyMetadata> LegacyScriptPubKeyMan::GetMetadata(const CTxDestination& dest) const
684{
685 LOCK(cs_KeyStore);
686
687 CKeyID key_id = GetKeyForDestination(*this, dest);
688 if (!key_id.IsNull()) {
689 auto it = mapKeyMetadata.find(key_id);
690 if (it != mapKeyMetadata.end()) {
691 return std::make_unique<CKeyMetadata>(it->second);
692 }
693 }
694
695 CScript scriptPubKey = GetScriptForDestination(dest);
696 auto it = m_script_metadata.find(CScriptID(scriptPubKey));
697 if (it != m_script_metadata.end()) {
698 return std::make_unique<CKeyMetadata>(it->second);
699 }
700
701 return nullptr;
702}
703
704uint256 LegacyScriptPubKeyMan::GetID() const
705{

Callers 1

getaddressinfoFunction · 0.45

Calls 7

GetKeyForDestinationFunction · 0.85
GetScriptForDestinationFunction · 0.85
CScriptIDClass · 0.85
findMethod · 0.80
IsNullMethod · 0.45
endMethod · 0.45
GetKeyOriginMethod · 0.45

Tested by

no test coverage detected