From bf6417142f36a2f75b3a11368bd73fe788ae1ccb Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Thu, 5 Dec 2019 18:14:53 -0500 Subject: Remove SetCrypted() and fUseCrypto; Change IsCrypted()'s implementation Removes SetCrypted() and fUseCrypto as we don't need them anymore. SetCrypted calls in LegacyScriptPubKeyMan are replaced with mapKeys.empty() IsCrypted() is changed to just call HasEncryptionKeys() --- src/wallet/wallet.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/wallet/wallet.cpp') diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 88399bbab..41a816312 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4002,15 +4002,9 @@ std::vector CWallet::GroupOutputs(const std::vector& outpu return groups; } -bool CWallet::SetCrypted() +bool CWallet::IsCrypted() const { - LOCK(cs_KeyStore); - if (fUseCrypto) - return true; - if (!mapKeys.empty()) - return false; - fUseCrypto = true; - return true; + return HasEncryptionKeys(); } bool CWallet::IsLocked() const @@ -4024,7 +4018,7 @@ bool CWallet::IsLocked() const bool CWallet::Lock() { - if (!SetCrypted()) + if (!IsCrypted()) return false; { -- cgit v1.2.3