wallet2_api: wallet recovery - seed offset passphrase support

This commit is contained in:
xiphon
2020-02-11 23:27:30 +00:00
parent 51873fec04
commit cc18926eba
5 changed files with 14 additions and 6 deletions

View File

@@ -725,7 +725,7 @@ bool WalletImpl::recover(const std::string &path, const std::string &seed)
return recover(path, "", seed);
}
bool WalletImpl::recover(const std::string &path, const std::string &password, const std::string &seed)
bool WalletImpl::recover(const std::string &path, const std::string &password, const std::string &seed, const std::string &seed_offset/* = {}*/)
{
clearStatus();
m_errorString.clear();
@@ -743,6 +743,10 @@ bool WalletImpl::recover(const std::string &path, const std::string &password, c
setStatusError(tr("Electrum-style word list failed verification"));
return false;
}
if (!seed_offset.empty())
{
recovery_key = cryptonote::decrypt_key(recovery_key, seed_offset);
}
if (old_language == crypto::ElectrumWords::old_language_name)
old_language = Language::English().get_language_name();