| 33 | string CWallet::defaultFileName(""); |
| 34 | |
| 35 | bool CWallet::Unlock(const SecureString &strWalletPassphrase) { |
| 36 | CCrypter crypter; |
| 37 | CKeyingMaterial vMasterKey; |
| 38 | |
| 39 | { |
| 40 | LOCK(cs_wallet); |
| 41 | for (const auto &pMasterKey : mapMasterKeys) { |
| 42 | if (!crypter.SetKeyFromPassphrase(strWalletPassphrase, pMasterKey.second.vchSalt, |
| 43 | pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod)) |
| 44 | return false; |
| 45 | if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, vMasterKey)) |
| 46 | continue; // try another master key |
| 47 | if (CCryptoKeyStore::Unlock(vMasterKey)) |
| 48 | return true; |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | return false; |
| 53 | } |
| 54 | |
| 55 | bool CWallet::ChangeWalletPassphrase(const SecureString &strOldWalletPassphrase, |
| 56 | const SecureString &strNewWalletPassphrase) { |
no test coverage detected