diff options
| author | Andrew Chow <[email protected]> | 2019-12-05 18:02:11 -0500 |
|---|---|---|
| committer | Andrew Chow <[email protected]> | 2019-12-06 15:05:47 -0500 |
| commit | 97c0374a46943b2ed38ea24eeeff1f1568dd55b3 (patch) | |
| tree | 9be6c26319a8cbdae6d9a098a5f53d9b3916543e /src/wallet/scriptpubkeyman.cpp | |
| parent | Replace LegacyScriptPubKeyMan::vMasterKey with GetDecryptionKey() (diff) | |
| download | discoin-97c0374a46943b2ed38ea24eeeff1f1568dd55b3.tar.xz discoin-97c0374a46943b2ed38ea24eeeff1f1568dd55b3.zip | |
Move Unlock implementation to LegacyScriptPubKeyMan
CWallet::Unlock is changed to call ScriptPubKeyMan::CheckDecryptionKey
and the original implementation of Unlock is renamed to CheckDecryptionKey.
Diffstat (limited to 'src/wallet/scriptpubkeyman.cpp')
| -rw-r--r-- | src/wallet/scriptpubkeyman.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index f9c2645ca..0adfefa1a 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -202,7 +202,7 @@ isminetype LegacyScriptPubKeyMan::IsMine(const CScript& script) const assert(false); } -bool CWallet::Unlock(const CKeyingMaterial& vMasterKeyIn, bool accept_no_keys) +bool LegacyScriptPubKeyMan::CheckDecryptionKey(const CKeyingMaterial& master_key, bool accept_no_keys) { { LOCK(cs_KeyStore); @@ -217,7 +217,7 @@ bool CWallet::Unlock(const CKeyingMaterial& vMasterKeyIn, bool accept_no_keys) const CPubKey &vchPubKey = (*mi).second.first; const std::vector<unsigned char> &vchCryptedSecret = (*mi).second.second; CKey key; - if (!DecryptKey(vMasterKeyIn, vchCryptedSecret, vchPubKey, key)) + if (!DecryptKey(master_key, vchCryptedSecret, vchPubKey, key)) { keyFail = true; break; @@ -233,10 +233,8 @@ bool CWallet::Unlock(const CKeyingMaterial& vMasterKeyIn, bool accept_no_keys) } if (keyFail || (!keyPass && !accept_no_keys)) return false; - vMasterKey = vMasterKeyIn; fDecryptionThoroughlyChecked = true; } - NotifyStatusChanged(this); return true; } |