mirror of
https://github.com/feather-wallet/feather.git
synced 2025-04-24 05:08:12 +00:00
seed: check legacy checksum
This commit is contained in:
parent
897afaaabb
commit
249183f0c1
1 changed files with 16 additions and 0 deletions
|
@ -7,6 +7,8 @@
|
|||
#include "monero_seed/monero_seed.hpp"
|
||||
#include "polyseed/polyseed.h"
|
||||
#include "utils/AppData.h"
|
||||
#include "crypto/crypto.h"
|
||||
#include "mnemonics/electrum-words.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
@ -132,6 +134,20 @@ Seed::Seed(Type type, QStringList mnemonic, NetworkType::Type networkType)
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (this->type == Type::MONERO) {
|
||||
crypto::secret_key recovery_key;
|
||||
std::string old_language;
|
||||
if (!crypto::ElectrumWords::words_to_bytes(mnemonic.join(" ").toStdString(), recovery_key, old_language)) {
|
||||
if (this->mnemonic.length() == 25) {
|
||||
this->errorString = "Invalid checksum word";
|
||||
}
|
||||
else {
|
||||
this->errorString = "Invalid seed";
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Seed::setRestoreHeight(int height) {
|
||||
|
|
Loading…
Reference in a new issue