void Seed::setRestoreHeight() {
// Ignore the embedded restore date, new wallets should sync from the current block height.
this->restoreHeight = appData()->restoreHeights[networkType]->dateToHeight(this->time);
+ int a = 0;
}
Seed::Seed() = default;
\ No newline at end of file
QMessageBox::information(this, "Corrected erasure", QString("xxxx -> %1").arg(_seed.correction));
}
- m_fields->seed = seedSplit.join(" ");
+ m_fields->seed = _seed;
m_fields->seedOffsetPassphrase = ui->line_seedOffset->text();
return true;
this->seedRoulette(0);
});
connect(ui->btnCopy, &QPushButton::clicked, [this]{
- Utils::copyToClipboard(m_mnemonic);
+ Utils::copyToClipboard(m_seed.mnemonic.join(" "));
});
}
}
void PageWalletSeed::generateSeed() {
- Seed seed;
+ QString mnemonic;
do {
- seed = Seed(Seed::Type::TEVADOR);
- m_mnemonic = seed.mnemonic.join(" ");
- m_restoreHeight = seed.restoreHeight;
- } while (m_mnemonic.split(" ").length() != 14); // https://github.com/tevador/monero-seed/issues/2
+ m_seed = Seed(Seed::Type::TEVADOR);
+ mnemonic = m_seed.mnemonic.join(" ");
+ m_restoreHeight = m_seed.restoreHeight;
+ } while (mnemonic.split(" ").length() != 14); // https://github.com/tevador/monero-seed/issues/2
- this->displaySeed(m_mnemonic);
+ this->displaySeed(mnemonic);
- if (!seed.errorString.isEmpty()) {
+ if (!m_seed.errorString.isEmpty()) {
ui->frame_invalidSeed->show();
ui->frame_seedDisplay->hide();
m_seedError = true;
}
bool PageWalletSeed::validatePage() {
- if (m_mnemonic.isEmpty()) return false;
+ if (m_seed.mnemonic.isEmpty()) return false;
if (!m_restoreHeight) return false;
QMessageBox seedWarning(this);
return false;
}
- m_fields->seed = m_mnemonic;
+ m_fields->seed = m_seed;
return true;
}
WizardFields *m_fields;
- QString m_mnemonic;
int m_restoreHeight;
bool m_seedError = false;
bool m_roulette = false;
int m_rouletteSpin = 15;
+ Seed m_seed;
};
#endif //FEATHER_CREATEWALLETSEED_H
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);
}
struct WizardFields {
QString walletName;
QString walletDir;
- QString seed;
+ Seed seed;
QString seedOffsetPassphrase;
QString seedLanguage = constants::seedLanguage;
QString password;