mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-23 13:24:18 +00:00
SetCrypted() obtains keystore lock, to be safe.
This commit is contained in:
parent
541e585d8e
commit
e3c26b2573
@ -33,6 +33,19 @@ bool CBasicKeyStore::AddKey(const CKey& key)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CCryptoKeyStore::SetCrypted()
|
||||||
|
{
|
||||||
|
CRITICAL_BLOCK(cs_KeyStore)
|
||||||
|
{
|
||||||
|
if (fUseCrypto)
|
||||||
|
return true;
|
||||||
|
if (!mapKeys.empty())
|
||||||
|
return false;
|
||||||
|
fUseCrypto = true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<unsigned char> CCryptoKeyStore::GenerateNewKey()
|
std::vector<unsigned char> CCryptoKeyStore::GenerateNewKey()
|
||||||
{
|
{
|
||||||
RandAddSeedPerfmon();
|
RandAddSeedPerfmon();
|
||||||
|
@ -65,15 +65,7 @@ private:
|
|||||||
bool fUseCrypto;
|
bool fUseCrypto;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool SetCrypted()
|
bool SetCrypted();
|
||||||
{
|
|
||||||
if (fUseCrypto)
|
|
||||||
return true;
|
|
||||||
if (!mapKeys.empty())
|
|
||||||
return false;
|
|
||||||
fUseCrypto = true;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// will encrypt previously unencrypted keys
|
// will encrypt previously unencrypted keys
|
||||||
bool EncryptKeys(CKeyingMaterial& vMasterKeyIn);
|
bool EncryptKeys(CKeyingMaterial& vMasterKeyIn);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user