mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge 6d8707b21d into merged_master (Bitcoin PR bitcoin-core/gui#631)
This commit is contained in:
commit
4de1ce421f
3 changed files with 12 additions and 0 deletions
|
|
@ -1324,6 +1324,12 @@ void BitcoinGUI::setEncryptionStatus(int status)
|
|||
{
|
||||
switch(status)
|
||||
{
|
||||
case WalletModel::NoKeys:
|
||||
labelWalletEncryptionIcon->hide();
|
||||
encryptWalletAction->setChecked(false);
|
||||
changePassphraseAction->setEnabled(false);
|
||||
encryptWalletAction->setEnabled(false);
|
||||
break;
|
||||
case WalletModel::Unencrypted:
|
||||
labelWalletEncryptionIcon->hide();
|
||||
encryptWalletAction->setChecked(false);
|
||||
|
|
|
|||
|
|
@ -345,6 +345,11 @@ WalletModel::EncryptionStatus WalletModel::getEncryptionStatus() const
|
|||
{
|
||||
if(!m_wallet->isCrypted())
|
||||
{
|
||||
// A previous bug allowed for watchonly wallets to be encrypted (encryption keys set, but nothing is actually encrypted).
|
||||
// To avoid misrepresenting the encryption status of such wallets, we only return NoKeys for watchonly wallets that are unencrypted.
|
||||
if (m_wallet->privateKeysDisabled()) {
|
||||
return NoKeys;
|
||||
}
|
||||
return Unencrypted;
|
||||
}
|
||||
else if(m_wallet->isLocked())
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ public:
|
|||
|
||||
enum EncryptionStatus
|
||||
{
|
||||
NoKeys, // wallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS)
|
||||
Unencrypted, // !wallet->IsCrypted()
|
||||
Locked, // wallet->IsCrypted() && wallet->IsLocked()
|
||||
Unlocked // wallet->IsCrypted() && !wallet->IsLocked()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue