Dont run full check every time we decrypt wallet.

pull/4670/head
Matt Corallo 10 years ago
parent 1e21c17d20
commit a35b55b522

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

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

Loading…
Cancel
Save