MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / GetKey

Method GetKey

src/wallet/scriptpubkeyman.cpp:393–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393bool LegacyDataSPKM::GetKey(const CKeyID &address, CKey& keyOut) const
394{
395 LOCK(cs_KeyStore);
396 if (!m_storage.HasEncryptionKeys()) {
397 return FillableSigningProvider::GetKey(address, keyOut);
398 }
399
400 CryptedKeyMap::const_iterator mi = mapCryptedKeys.find(address);
401 if (mi != mapCryptedKeys.end())
402 {
403 const CPubKey &vchPubKey = (*mi).second.first;
404 const std::vector<unsigned char> &vchCryptedSecret = (*mi).second.second;
405 return m_storage.WithEncryptionKey([&](const CKeyingMaterial& encryption_key) {
406 return DecryptKey(encryption_key, vchCryptedSecret, vchPubKey, keyOut);
407 });
408 }
409 return false;
410}
411
412bool LegacyDataSPKM::GetKeyOrigin(const CKeyID& keyID, KeyOriginInfo& info) const
413{

Callers 1

SignMessageMethod · 0.45

Calls 6

DecryptKeyFunction · 0.85
HasEncryptionKeysMethod · 0.80
findMethod · 0.80
WithEncryptionKeyMethod · 0.80
IsLockedMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected