Move Unlock implementation to LegacyScriptPubKeyMan

CWallet::Unlock is changed to call ScriptPubKeyMan::CheckDecryptionKey
and the original implementation of Unlock is renamed to CheckDecryptionKey.
This commit is contained in:
Andrew Chow
2019-12-05 18:02:11 -05:00
parent e576b135d6
commit 97c0374a46
3 changed files with 21 additions and 4 deletions

View File

@@ -4037,6 +4037,21 @@ bool CWallet::Lock()
return true;
}
bool CWallet::Unlock(const CKeyingMaterial& vMasterKeyIn, bool accept_no_keys)
{
{
LOCK(cs_KeyStore);
if (m_spk_man) {
if (!m_spk_man->CheckDecryptionKey(vMasterKeyIn, accept_no_keys)) {
return false;
}
}
vMasterKey = vMasterKeyIn;
}
NotifyStatusChanged(this);
return true;
}
ScriptPubKeyMan* CWallet::GetScriptPubKeyMan(const CScript& script) const
{
return m_spk_man.get();