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()
This commit is contained in:
Andrew Chow
2019-12-05 18:14:53 -05:00
parent 77a777118e
commit bf6417142f
4 changed files with 9 additions and 29 deletions

View File

@@ -4002,15 +4002,9 @@ std::vector<OutputGroup> CWallet::GroupOutputs(const std::vector<COutput>& 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;
{