Browse Source

Dont run full check every time we decrypt wallet.

0.10
Matt Corallo 11 years ago
parent
commit
a35b55b522
  1. 3
      src/crypter.cpp
  2. 5
      src/crypter.h

3
src/crypter.cpp

@ -178,6 +178,8 @@ bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn) @@ -178,6 +178,8 @@ bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn)
break;
}
keyPass = true;
if (fDecryptionThoroughlyChecked)
break;
}
if (keyPass && keyFail)
{
@ -187,6 +189,7 @@ bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn) @@ -187,6 +189,7 @@ bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn)
if (keyFail || !keyPass)
return false;
vMasterKey = vMasterKeyIn;
fDecryptionThoroughlyChecked = true;
}
NotifyStatusChanged(this);
return true;

5
src/crypter.h

@ -121,6 +121,9 @@ private: @@ -121,6 +121,9 @@ private:
// if fUseCrypto is false, vMasterKey must be empty
bool fUseCrypto;
// keeps track of whether Unlock has run a thourough check before
bool fDecryptionThoroughlyChecked;
protected:
bool SetCrypted();
@ -130,7 +133,7 @@ protected: @@ -130,7 +133,7 @@ protected:
bool Unlock(const CKeyingMaterial& vMasterKeyIn);
public:
CCryptoKeyStore() : fUseCrypto(false)
CCryptoKeyStore() : fUseCrypto(false), fDecryptionThoroughlyChecked(false)
{
}

Loading…
Cancel
Save