Seed: refactor

This commit is contained in:
tobtoht
2022-02-25 16:29:33 +01:00
parent f8bc335720
commit c6264ed3a0
13 changed files with 869 additions and 695 deletions
+5 -3
View File
@@ -117,15 +117,17 @@ void WalletWizard::onCreateWallet() {
return;
}
auto seed = FeatherSeed(constants::networkType, QString::fromStdString(constants::coinName), constants::seedLanguage, m_wizardFields.seed.split(" "));
auto seed = Seed(m_wizardFields.seedType, m_wizardFields.seed.split(" "), constants::networkType);
// If we're connected to the websocket, use the reported height for new wallets to skip initial synchronization.
if (m_wizardFields.mode == WizardMode::CreateWallet && currentBlockHeight > 0) {
qInfo() << "New wallet, setting restore height to latest blockheight: " << currentBlockHeight;
seed.setRestoreHeight(currentBlockHeight);
seed.restoreHeight = currentBlockHeight;
}
if (m_wizardFields.mode == WizardMode::RestoreFromSeed && m_wizardFields.seedType == SeedType::MONERO)
if (m_wizardFields.mode == WizardMode::RestoreFromSeed && m_wizardFields.seedType == Seed::Type::MONERO) {
seed.setRestoreHeight(m_wizardFields.restoreHeight);
}
emit createWallet(seed, walletPath, m_wizardFields.password, m_wizardFields.seedLanguage, m_wizardFields.seedOffsetPassphrase);
}