Skip to content

Commit 84ffada

Browse files
committed
[Model] isWalletUnlocked method created.
1 parent 1bbf8c4 commit 84ffada

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/qt/walletmodel.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ void WalletModel::updateStatus()
133133
emit encryptionStatusChanged(newEncryptionStatus);
134134
}
135135

136+
bool WalletModel::isWalletUnlocked() const {
137+
EncryptionStatus status = getEncryptionStatus();
138+
return status == Unencrypted || status == Unlocked;
139+
}
140+
136141
void WalletModel::pollBalanceChanged()
137142
{
138143
// Get required locks upfront. This avoids the GUI from getting stuck on

src/qt/walletmodel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ class WalletModel : public QObject
145145
CAmount getWatchUnconfirmedBalance() const;
146146
CAmount getWatchImmatureBalance() const;
147147
EncryptionStatus getEncryptionStatus() const;
148+
bool isWalletUnlocked() const;
148149
CKey generateNewKey() const; //for temporary paper wallet key generation
149150
bool setAddressBook(const CTxDestination& address, const std::string& strName, const std::string& strPurpose);
150151
void encryptKey(const CKey key, const std::string& pwd, const std::string& slt, std::vector<unsigned char>& crypted);

0 commit comments

Comments
 (0)