refactor: simplify implementation of function CWallet::IsLocked

This commit is contained in:
Konstantin Akimov 2024-07-03 15:32:27 +07:00
parent 685cf34cb9
commit c944908399
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524

View File

@ -5459,21 +5459,11 @@ bool CWallet::IsLocked(bool fForMixing) const
{
if (!IsCrypted())
return false;
bool result;
{
LOCK(cs_wallet);
result = vMasterKey.empty();
}
// fForMixing fOnlyMixingAllowed return
// ---------------------------------------
// true true result
// true false result
// false true true
// false false result
if(!fForMixing && fOnlyMixingAllowed) return true;
return result;
LOCK(cs_wallet);
return vMasterKey.empty();
}
bool CWallet::Lock(bool fAllowMixing)