Skip to content

Commit

Permalink
Merge pull request #36 from Stipend-Developer/task/could_not_unlock_w…
Browse files Browse the repository at this point in the history
…allet_when_wallet_unencrypted

Some users are complaining that they cannot create a new receiving address
  • Loading branch information
Stipend-Developer committed Jun 13, 2018
2 parents e2b11aa + d99040a commit d944235
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/qt/walletmodel.cpp
Expand Up @@ -794,16 +794,23 @@ WalletModel::UnlockContext WalletModel::requestUnlock()
|| wasEncryptionStatus == UnlockedForStakingOnly
|| wasEncryptionStatus == UnlockedForAnonymizationOnly;

bool valid = false;

// if the wallet is already unlocked, we do not show UI and just
// continue.
if (requestingUnlockRequired)
{
// Request UI to unlock wallet
emit requireUnlock();
}

// If wallet was not unlocked, unlock was failed or cancelled, mark context as invalid
bool valid = getEncryptionStatus() == Unlocked;
// If wallet was not unlocked, unlock was failed or cancelled, mark context as invalid
valid = getEncryptionStatus() == Unlocked;
}
else
{
// If wallet is unencrypted or unlocked.
valid = wasEncryptionStatus == Unencrypted || wasEncryptionStatus == Unlocked;
}

return UnlockContext(this, valid,
// We want to restore initial state if we requested unlock from user.
Expand Down

0 comments on commit d944235

Please sign in to comment.