mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 18:02:13 +02:00
Fix passphrase crash
This commit is contained in:
parent
fcafbef109
commit
1ed10ecf59
3 changed files with 7 additions and 3 deletions
|
@ -119,7 +119,9 @@ void QmlCommerce::history() {
|
|||
|
||||
void QmlCommerce::changePassphrase(const QString& oldPassphrase, const QString& newPassphrase) {
|
||||
auto wallet = DependencyManager::get<Wallet>();
|
||||
if ((wallet->getPassphrase()->isEmpty() || wallet->getPassphrase() == oldPassphrase) && !newPassphrase.isEmpty()) {
|
||||
if (wallet->getPassphrase()->isEmpty()) {
|
||||
emit changePassphraseStatusResult(wallet->setPassphrase(newPassphrase));
|
||||
} else if (wallet->getPassphrase() == oldPassphrase && !newPassphrase.isEmpty()) {
|
||||
emit changePassphraseStatusResult(wallet->changePassphrase(newPassphrase));
|
||||
} else {
|
||||
emit changePassphraseStatusResult(false);
|
||||
|
|
|
@ -293,13 +293,15 @@ Wallet::~Wallet() {
|
|||
}
|
||||
}
|
||||
|
||||
void Wallet::setPassphrase(const QString& passphrase) {
|
||||
bool Wallet::setPassphrase(const QString& passphrase) {
|
||||
if (_passphrase) {
|
||||
delete _passphrase;
|
||||
}
|
||||
_passphrase = new QString(passphrase);
|
||||
|
||||
_publicKeys.clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Wallet::writeSecurityImage(const QPixmap* pixmap, const QString& outputFilePath) {
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
void setCKey(const QByteArray& ckey) { _ckey = ckey; }
|
||||
QByteArray getCKey() { return _ckey; }
|
||||
|
||||
void setPassphrase(const QString& passphrase);
|
||||
bool setPassphrase(const QString& passphrase);
|
||||
QString* getPassphrase() { return _passphrase; }
|
||||
bool getPassphraseIsCached() { return !(_passphrase->isEmpty()); }
|
||||
bool walletIsAuthenticatedWithPassphrase();
|
||||
|
|
Loading…
Reference in a new issue