File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -152,14 +152,15 @@ void AskPassphraseDialog::accept()
152
152
}
153
153
} break ;
154
154
case Unlock:
155
- if (!model->setWalletLocked (false , oldpass))
156
- {
157
- QMessageBox::critical (this , tr (" Wallet unlock failed" ),
158
- tr (" The passphrase entered for the wallet decryption was incorrect." ));
159
- }
160
- else
161
- {
162
- QDialog::accept (); // Success
155
+ try {
156
+ if (!model->setWalletLocked (false , oldpass)) {
157
+ QMessageBox::critical (this , tr (" Wallet unlock failed" ),
158
+ tr (" The passphrase entered for the wallet decryption was incorrect." ));
159
+ } else {
160
+ QDialog::accept (); // Success
161
+ }
162
+ } catch (const std::runtime_error& e) {
163
+ QMessageBox::critical (this , tr (" Wallet unlock failed" ), e.what ());
163
164
}
164
165
break ;
165
166
case Decrypt:
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn)
202
202
if (keyPass && keyFail)
203
203
{
204
204
LogPrintf (" The wallet is probably corrupted: Some keys decrypt but not all.\n " );
205
- assert ( false );
205
+ throw std::runtime_error ( " Error unlocking wallet: some keys decrypt but not all. Your wallet file may be corrupt. " );
206
206
}
207
207
if (keyFail || !keyPass)
208
208
return false ;
You can’t perform that action at this time.
0 commit comments