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

Method GetKeyOrigin

src/wallet/scriptpubkeyman.cpp:1010–1027  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1008}
1009
1010bool LegacyScriptPubKeyMan::GetKeyOrigin(const CKeyID& keyID, KeyOriginInfo& info) const
1011{
1012 CKeyMetadata meta;
1013 {
1014 LOCK(cs_KeyStore);
1015 auto it = mapKeyMetadata.find(keyID);
1016 if (it != mapKeyMetadata.end()) {
1017 meta = it->second;
1018 }
1019 }
1020 if (meta.has_key_origin) {
1021 std::copy(meta.key_origin.fingerprint, meta.key_origin.fingerprint + 4, info.fingerprint);
1022 info.path = meta.key_origin.path;
1023 } else { // Single pubkeys get the master fingerprint of themselves
1024 std::copy(keyID.begin(), keyID.begin() + 4, info.fingerprint);
1025 }
1026 return true;
1027}
1028
1029bool LegacyScriptPubKeyMan::GetWatchPubKey(const CKeyID &address, CPubKey &pubkey_out) const
1030{

Callers 2

GetMetadataMethod · 0.45
FUZZ_TARGET_INITFunction · 0.45

Calls 3

findMethod · 0.80
endMethod · 0.45
beginMethod · 0.45

Tested by 1

FUZZ_TARGET_INITFunction · 0.36