mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-11-16 15:58:11 +00:00
Merge pull request #3420
becc747
WalletManager: support kdf round in device wallet restore (selsta)
This commit is contained in:
commit
4ddc6b1c90
3 changed files with 11 additions and 8 deletions
|
@ -169,7 +169,7 @@ Wallet *WalletManager::createWalletFromKeys(const QString &path, const QString &
|
|||
}
|
||||
|
||||
Wallet *WalletManager::createWalletFromDevice(const QString &path, const QString &password, NetworkType::Type nettype,
|
||||
const QString &deviceName, quint64 restoreHeight, const QString &subaddressLookahead)
|
||||
const QString &deviceName, quint64 restoreHeight, const QString &subaddressLookahead, quint64 kdfRounds)
|
||||
{
|
||||
QMutexLocker locker(&m_mutex);
|
||||
WalletPassphraseListenerImpl tmpListener(this);
|
||||
|
@ -187,7 +187,7 @@ Wallet *WalletManager::createWalletFromDevice(const QString &path, const QString
|
|||
m_currentWallet = NULL;
|
||||
}
|
||||
Monero::Wallet * w = m_pimpl->createWalletFromDevice(path.toStdString(), password.toStdString(), static_cast<Monero::NetworkType>(nettype),
|
||||
deviceName.toStdString(), restoreHeight, subaddressLookahead.toStdString(), 1, &tmpListener);
|
||||
deviceName.toStdString(), restoreHeight, subaddressLookahead.toStdString(), kdfRounds, &tmpListener);
|
||||
w->setListener(nullptr);
|
||||
|
||||
m_currentWallet = new Wallet(w);
|
||||
|
@ -202,10 +202,10 @@ Wallet *WalletManager::createWalletFromDevice(const QString &path, const QString
|
|||
|
||||
|
||||
void WalletManager::createWalletFromDeviceAsync(const QString &path, const QString &password, NetworkType::Type nettype,
|
||||
const QString &deviceName, quint64 restoreHeight, const QString &subaddressLookahead)
|
||||
const QString &deviceName, quint64 restoreHeight, const QString &subaddressLookahead, quint64 kdfRounds)
|
||||
{
|
||||
m_scheduler.run([this, path, password, nettype, deviceName, restoreHeight, subaddressLookahead] {
|
||||
Wallet *wallet = createWalletFromDevice(path, password, nettype, deviceName, restoreHeight, subaddressLookahead);
|
||||
m_scheduler.run([this, path, password, nettype, deviceName, restoreHeight, subaddressLookahead, kdfRounds] {
|
||||
Wallet *wallet = createWalletFromDevice(path, password, nettype, deviceName, restoreHeight, subaddressLookahead, kdfRounds);
|
||||
emit walletCreated(wallet);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -103,14 +103,16 @@ public:
|
|||
NetworkType::Type nettype,
|
||||
const QString &deviceName,
|
||||
quint64 restoreHeight = 0,
|
||||
const QString &subaddressLookahead = "");
|
||||
const QString &subaddressLookahead = "",
|
||||
quint64 kdfRounds = 1);
|
||||
|
||||
Q_INVOKABLE void createWalletFromDeviceAsync(const QString &path,
|
||||
const QString &password,
|
||||
NetworkType::Type nettype,
|
||||
const QString &deviceName,
|
||||
quint64 restoreHeight = 0,
|
||||
const QString &subaddressLookahead = "");
|
||||
const QString &subaddressLookahead = "",
|
||||
quint64 kdfRounds = 1);
|
||||
/*!
|
||||
* \brief closeWallet - closes current open wallet and frees memory
|
||||
* \return wallet address
|
||||
|
|
|
@ -450,12 +450,13 @@ Rectangle {
|
|||
tmpWalletFilename = oshelper.temporaryFilename();
|
||||
console.log("Creating temporary wallet", tmpWalletFilename)
|
||||
var nettype = persistentSettings.nettype;
|
||||
var kdfRounds = persistentSettings.kdfRounds;
|
||||
var restoreHeight = wizardController.walletOptionsRestoreHeight;
|
||||
var subaddressLookahead = wizardController.walletOptionsSubaddressLookahead;
|
||||
var deviceName = wizardController.walletOptionsDeviceName;
|
||||
|
||||
connect();
|
||||
walletManager.createWalletFromDeviceAsync(tmpWalletFilename, "", nettype, deviceName, restoreHeight, subaddressLookahead);
|
||||
walletManager.createWalletFromDeviceAsync(tmpWalletFilename, "", nettype, deviceName, restoreHeight, subaddressLookahead, kdfRounds);
|
||||
creatingWalletDeviceSplash();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue