generate a new keypair if one isn't found in settings

This commit is contained in:
Stephen Birarda 2014-10-15 10:36:21 -07:00
parent 9a3ba972e1
commit e4b19545b0
2 changed files with 7 additions and 0 deletions

View file

@ -146,6 +146,12 @@ void AccountManager::setAuthURL(const QUrl& authURL) {
} else {
requestProfile();
}
// if we don't have a private key in settings we should generate a new keypair
if (!_accountInfo.hasPrivateKey()) {
qDebug() << "No private key present - generating a new key-pair.";
generateNewKeypair();
}
}
}
}

View file

@ -44,6 +44,7 @@ public:
void setWalletID(const QUuid& walletID);
const QByteArray& getUsernameSignature();
bool hasPrivateKey() const { return !_privateKey.isEmpty(); }
void setPrivateKey(const QByteArray& privateKey);
qint64 getBalance() const { return _balance; }