mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Do not use obsolete CPrivKey for passing keys around
This commit is contained in:
committed by
Matt Corallo
parent
b6b039d84e
commit
0efda1a79e
@@ -100,7 +100,7 @@ bool CCryptoKeyStore::AddCryptedKey(const std::vector<unsigned char> &vchPubKey,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CCryptoKeyStore::GetPrivKey(const std::vector<unsigned char> &vchPubKey, CPrivKey& keyOut) const
|
||||
bool CCryptoKeyStore::GetPrivKey(const std::vector<unsigned char> &vchPubKey, CKey& keyOut) const
|
||||
{
|
||||
CRITICAL_BLOCK(cs_vMasterKey)
|
||||
{
|
||||
@@ -114,9 +114,7 @@ bool CCryptoKeyStore::GetPrivKey(const std::vector<unsigned char> &vchPubKey, CP
|
||||
CSecret vchSecret;
|
||||
if (!DecryptSecret(vMasterKey, (*mi).second, Hash((*mi).first.begin(), (*mi).first.end()), vchSecret))
|
||||
return false;
|
||||
CKey key;
|
||||
key.SetSecret(vchSecret);
|
||||
keyOut = key.GetPrivKey();
|
||||
keyOut.SetSecret(vchSecret);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user