MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / AddKeyPubKey

Method AddKeyPubKey

src/wallet/crypter.cpp:201–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201bool CCryptoKeyStore::AddKeyPubKey(const CKey& key, const CPubKey &pubkey)
202{
203 {
204 LOCK(cs_KeyStore);
205 if (!IsCrypted())
206 return CBasicKeyStore::AddKeyPubKey(key, pubkey);
207
208 if (IsLocked())
209 return false;
210
211 std::vector<unsigned char> vchCryptedSecret;
212 CKeyingMaterial vchSecret(key.begin(), key.end());
213 if (!EncryptSecret(vMasterKey, vchSecret, pubkey.GetHash(), vchCryptedSecret))
214 return false;
215
216 if (!AddCryptedKey(pubkey, vchCryptedSecret))
217 return false;
218 }
219 return true;
220}
221
222
223bool CCryptoKeyStore::AddCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret)

Callers

nothing calls this directly

Calls 4

EncryptSecretFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected