MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / Unlock

Method Unlock

src/wallet/wallet.cpp:411–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409}
410
411bool CWallet::Unlock(const SecureString& strWalletPassphrase)
412{
413 CCrypter crypter;
414 CKeyingMaterial _vMasterKey;
415
416 {
417 LOCK(cs_wallet);
418 for (const MasterKeyMap::value_type& pMasterKey : mapMasterKeys)
419 {
420 if(!crypter.SetKeyFromPassphrase(strWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod))
421 return false;
422 if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, _vMasterKey))
423 continue; // try another master key
424 if (CCryptoKeyStore::Unlock(_vMasterKey))
425 return true;
426 }
427 }
428 return false;
429}
430
431bool CWallet::ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase, const SecureString& strNewWalletPassphrase)
432{

Callers 2

walletpassphraseFunction · 0.45
unlockMethod · 0.45

Calls 2

SetKeyFromPassphraseMethod · 0.80
DecryptMethod · 0.45

Tested by

no test coverage detected