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()
152152 }
153153 } break ;
154154 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 ());
163164 }
164165 break ;
165166 case Decrypt:
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ bool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn)
202202 if (keyPass && keyFail)
203203 {
204204 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. " );
206206 }
207207 if (keyFail || !keyPass)
208208 return false ;
You can’t perform that action at this time.
0 commit comments