Do not use obsolete CPrivKey for passing keys around

This commit is contained in:
Pieter Wuille
2011-07-03 15:33:01 +02:00
committed by Matt Corallo
parent b6b039d84e
commit 0efda1a79e
4 changed files with 12 additions and 30 deletions

View File

@@ -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;
}
}