aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorselsta <selsta@sent.at>2021-04-20 21:44:23 +0200
committerselsta <selsta@sent.at>2021-04-20 21:44:23 +0200
commitbecc74714b51e43fd71314701fba35bdab3af5a1 (patch)
tree43538930dae3a683b14df597d94c848f7a27c4a2
parent02ae14fd6bcd705ed838fba627775e4d8d52b5f3 (diff)
downloadmonzero-gui-becc74714b51e43fd71314701fba35bdab3af5a1.tar.gz
monzero-gui-becc74714b51e43fd71314701fba35bdab3af5a1.tar.xz
monzero-gui-becc74714b51e43fd71314701fba35bdab3af5a1.zip
WalletManager: support kdf round in device wallet restore
-rw-r--r--src/libwalletqt/WalletManager.cpp10
-rw-r--r--src/libwalletqt/WalletManager.h6
-rw-r--r--wizard/WizardController.qml3
3 files changed, 11 insertions, 8 deletions
diff --git a/src/libwalletqt/WalletManager.cpp b/src/libwalletqt/WalletManager.cpp
index 9876e1f3..0c87c8e2 100644
--- a/src/libwalletqt/WalletManager.cpp
+++ b/src/libwalletqt/WalletManager.cpp
@@ -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);
});
}
diff --git a/src/libwalletqt/WalletManager.h b/src/libwalletqt/WalletManager.h
index 25c62faf..210004a9 100644
--- a/src/libwalletqt/WalletManager.h
+++ b/src/libwalletqt/WalletManager.h
@@ -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
diff --git a/wizard/WizardController.qml b/wizard/WizardController.qml
index 7467fb3d..ba5266e0 100644
--- a/wizard/WizardController.qml
+++ b/wizard/WizardController.qml
@@ -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();
}