diff options
Diffstat (limited to 'src/keystore.cpp')
-rw-r--r-- | src/keystore.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/keystore.cpp b/src/keystore.cpp index 313518711b..55fba4c372 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -5,6 +5,7 @@ #include "keystore.h" #include "script.h" +#include "ui_interface.h" bool CKeyStore::GetPubKey(const CBitcoinAddress &address, std::vector<unsigned char> &vchPubKeyOut) const { @@ -73,6 +74,20 @@ bool CCryptoKeyStore::SetCrypted() return true; } +bool CCryptoKeyStore::Lock() +{ + if (!SetCrypted()) + return false; + + { + LOCK(cs_KeyStore); + vMasterKey.clear(); + } + + NotifyKeyStoreStatusChanged(this); + return true; +} + bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn) { { @@ -99,6 +114,7 @@ bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn) } vMasterKey = vMasterKeyIn; } + NotifyKeyStoreStatusChanged(this); return true; } |