diff --git a/src/keystore.cpp b/src/keystore.cpp index 5bf919cb..68f57e7e 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -33,6 +33,19 @@ bool CBasicKeyStore::AddKey(const CKey& key) return true; } +bool CCryptoKeyStore::SetCrypted() +{ + CRITICAL_BLOCK(cs_KeyStore) + { + if (fUseCrypto) + return true; + if (!mapKeys.empty()) + return false; + fUseCrypto = true; + } + return true; +} + std::vector CCryptoKeyStore::GenerateNewKey() { RandAddSeedPerfmon(); diff --git a/src/keystore.h b/src/keystore.h index d1e4985d..bbfac83d 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -65,15 +65,7 @@ private: bool fUseCrypto; protected: - bool SetCrypted() - { - if (fUseCrypto) - return true; - if (!mapKeys.empty()) - return false; - fUseCrypto = true; - return true; - } + bool SetCrypted(); // will encrypt previously unencrypted keys bool EncryptKeys(CKeyingMaterial& vMasterKeyIn);