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

Method AddKeyPubKeyInner

src/wallet/scriptpubkeyman.cpp:806–827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

804}
805
806bool LegacyScriptPubKeyMan::AddKeyPubKeyInner(const CKey& key, const CPubKey &pubkey)
807{
808 LOCK(cs_KeyStore);
809 if (!m_storage.HasEncryptionKeys()) {
810 return FillableSigningProvider::AddKeyPubKey(key, pubkey);
811 }
812
813 if (m_storage.IsLocked()) {
814 return false;
815 }
816
817 std::vector<unsigned char> vchCryptedSecret;
818 CKeyingMaterial vchSecret(key.begin(), key.end());
819 if (!EncryptSecret(m_storage.GetEncryptionKey(), vchSecret, pubkey.GetHash(), vchCryptedSecret)) {
820 return false;
821 }
822
823 if (!AddCryptedKey(pubkey, vchCryptedSecret)) {
824 return false;
825 }
826 return true;
827}
828
829bool LegacyScriptPubKeyMan::LoadCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret, bool checksum_valid)
830{

Callers

nothing calls this directly

Calls 6

EncryptSecretFunction · 0.85
HasEncryptionKeysMethod · 0.80
IsLockedMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected