From c94490839912e21965a01655fa24f837f037b4f6 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Wed, 3 Jul 2024 15:32:27 +0700 Subject: [PATCH] refactor: simplify implementation of function CWallet::IsLocked --- src/wallet/wallet.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 4bd880888c..29d6104270 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -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)