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

Method Unlock

src/wallet/wallet.cpp:615–634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

613}
614
615bool CWallet::Unlock(const SecureString& strWalletPassphrase)
616{
617 CKeyingMaterial plain_master_key;
618
619 {
620 LOCK(cs_wallet);
621 for (const auto& [_, master_key] : mapMasterKeys)
622 {
623 if (!DecryptMasterKey(strWalletPassphrase, master_key, plain_master_key)) {
624 continue; // try another master key
625 }
626 if (Unlock(plain_master_key)) {
627 // Now that we've unlocked, upgrade the descriptor cache
628 UpgradeDescriptorCache();
629 return true;
630 }
631 }
632 }
633 return false;
634}
635
636bool CWallet::ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase, const SecureString& strNewWalletPassphrase)
637{

Callers 15

unlockMethod · 0.80
walletpassphraseFunction · 0.80
RunBenchmarkMethod · 0.80
LOCKS_EXCLUDEDMethod · 0.80
ScheduleMethod · 0.80
BackgroundThreadMainMethod · 0.80
UNLOCK_FUNCTIONFunction · 0.80
ThreadBodyFunction · 0.80
ScheduleMethod · 0.80
BackgroundThreadMainMethod · 0.80
LOCKS_EXCLUDEDMethod · 0.80

Calls 3

DecryptMasterKeyFunction · 0.85
UnlockFunction · 0.85
CheckDecryptionKeyMethod · 0.45

Tested by 3

ThreadBodyFunction · 0.64
LOCKS_EXCLUDEDMethod · 0.64