| 3388 | } |
| 3389 | |
| 3390 | bool CWallet::Lock() |
| 3391 | { |
| 3392 | if (!HasEncryptionKeys()) |
| 3393 | return false; |
| 3394 | |
| 3395 | { |
| 3396 | LOCK2(m_relock_mutex, cs_wallet); |
| 3397 | if (!vMasterKey.empty()) { |
| 3398 | memory_cleanse(vMasterKey.data(), vMasterKey.size() * sizeof(decltype(vMasterKey)::value_type)); |
| 3399 | vMasterKey.clear(); |
| 3400 | } |
| 3401 | } |
| 3402 | |
| 3403 | NotifyStatusChanged(this); |
| 3404 | return true; |
| 3405 | } |
| 3406 | |
| 3407 | bool CWallet::Unlock(const CKeyingMaterial& vMasterKeyIn) |
| 3408 | { |