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

Method GetKeys

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

Source from the content-addressed store, hash-verified

991}
992
993std::map<CKeyID, CKey> DescriptorScriptPubKeyMan::GetKeys() const
994{
995 AssertLockHeld(cs_desc_man);
996 if (m_storage.HasEncryptionKeys() && !m_storage.IsLocked()) {
997 KeyMap keys;
998 for (const auto& key_pair : m_map_crypted_keys) {
999 const CPubKey& pubkey = key_pair.second.first;
1000 const std::vector<unsigned char>& crypted_secret = key_pair.second.second;
1001 CKey key;
1002 m_storage.WithEncryptionKey([&](const CKeyingMaterial& encryption_key) {
1003 return DecryptKey(encryption_key, crypted_secret, pubkey, key);
1004 });
1005 keys[pubkey.GetID()] = key;
1006 }
1007 return keys;
1008 }
1009 return m_map_keys;
1010}
1011
1012bool DescriptorScriptPubKeyMan::HasPrivKey(const CKeyID& keyid) const
1013{

Callers 1

key.cppFile · 0.45

Calls 5

DecryptKeyFunction · 0.85
HasEncryptionKeysMethod · 0.80
IsLockedMethod · 0.80
WithEncryptionKeyMethod · 0.80
GetIDMethod · 0.45

Tested by

no test coverage detected