Пример #1
0
bool CAccount::Encrypt(const CKeyingMaterial& vMasterKeyIn)
{
    // NB! We don't encrypt the keystores for witness-only accounts - as they only contain keys for witnessing.
    // So we don't need to unlock the underlying keystore..
    if (IsFixedKeyPool() && IsPoW2Witness())
    {
        return true;
    }

    bool needsWriteToDisk;
    if (!EncryptKeys(vMasterKeyIn))
        return false;
    if (!externalKeyStore.SetCrypted() || !externalKeyStore.Unlock(vMasterKeyIn, needsWriteToDisk))
        return false;
    if (!internalKeyStore.SetCrypted() || !internalKeyStore.Unlock(vMasterKeyIn, needsWriteToDisk))
        return false;

    vMasterKey = vMasterKeyIn;

    return true;
}
Пример #2
0
bool CAccount::Encrypt(CKeyingMaterial& vMasterKeyIn)
{
    return EncryptKeys(vMasterKeyIn) /*&& SetCrypted()*/;
}