Wizard: reduce new wallet sync time

This commit is contained in:
tobtoht
2022-02-25 21:22:03 +01:00
parent f816f44f4c
commit f3ef0bd675
6 changed files with 17 additions and 18 deletions
+3 -5
View File
@@ -117,17 +117,15 @@ void WalletWizard::onCreateWallet() {
return;
}
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.restoreHeight = currentBlockHeight;
m_wizardFields.seed.restoreHeight = currentBlockHeight;
}
if (m_wizardFields.mode == WizardMode::RestoreFromSeed && m_wizardFields.seedType == Seed::Type::MONERO) {
seed.setRestoreHeight(m_wizardFields.restoreHeight);
m_wizardFields.seed.setRestoreHeight(m_wizardFields.restoreHeight);
}
emit createWallet(seed, walletPath, m_wizardFields.password, m_wizardFields.seedLanguage, m_wizardFields.seedOffsetPassphrase);
emit createWallet(m_wizardFields.seed, walletPath, m_wizardFields.password, m_wizardFields.seedLanguage, m_wizardFields.seedOffsetPassphrase);
}