Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/crypter.cpp
Show First 20 Lines • Show All 177 Lines • ▼ Show 20 Lines | bool CCryptoKeyStore::Unlock(const CKeyingMaterial &vMasterKeyIn) { | ||||
if (!DecryptKey(vMasterKeyIn, vchCryptedSecret, vchPubKey, key)) { | if (!DecryptKey(vMasterKeyIn, vchCryptedSecret, vchPubKey, key)) { | ||||
keyFail = true; | keyFail = true; | ||||
break; | break; | ||||
} | } | ||||
keyPass = true; | keyPass = true; | ||||
if (fDecryptionThoroughlyChecked) break; | if (fDecryptionThoroughlyChecked) break; | ||||
} | } | ||||
if (keyPass && keyFail) { | if (keyPass && keyFail) { | ||||
LogPrintf("The wallet is probably corrupted: Some keys decrypt but " | LogPrint(BCLog::WALLET, | ||||
"The wallet is probably corrupted: Some keys decrypt but " | |||||
"not all.\n"); | "not all.\n"); | ||||
assert(false); | assert(false); | ||||
} | } | ||||
if (keyFail || !keyPass) return false; | if (keyFail || !keyPass) return false; | ||||
vMasterKey = vMasterKeyIn; | vMasterKey = vMasterKeyIn; | ||||
fDecryptionThoroughlyChecked = true; | fDecryptionThoroughlyChecked = true; | ||||
} | } | ||||
NotifyStatusChanged(this); | NotifyStatusChanged(this); | ||||
return true; | return true; | ||||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |