aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api/wallet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/api/wallet.cpp')
-rw-r--r--src/wallet/api/wallet.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index 4e389f2e2..fcf5c8844 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -458,6 +458,16 @@ bool WalletImpl::recoverFromKeys(const std::string &path,
const std::string &viewkey_string,
const std::string &spendkey_string)
{
+ return recoverFromKeysWithPassword(path, "", language, address_string, viewkey_string, spendkey_string);
+}
+
+bool WalletImpl::recoverFromKeysWithPassword(const std::string &path,
+ const std::string &password,
+ const std::string &language,
+ const std::string &address_string,
+ const std::string &viewkey_string,
+ const std::string &spendkey_string)
+{
cryptonote::address_parse_info info;
if(!get_account_address_from_str(info, m_wallet->testnet(), address_string))
{
@@ -524,12 +534,12 @@ bool WalletImpl::recoverFromKeys(const std::string &path,
try
{
if (has_spendkey) {
- m_wallet->generate(path, "", info.address, spendkey, viewkey);
+ m_wallet->generate(path, password, info.address, spendkey, viewkey);
setSeedLanguage(language);
LOG_PRINT_L1("Generated new wallet from keys with seed language: " + language);
}
else {
- m_wallet->generate(path, "", info.address, viewkey);
+ m_wallet->generate(path, password, info.address, viewkey);
LOG_PRINT_L1("Generated new view only wallet from keys");
}
@@ -570,6 +580,11 @@ bool WalletImpl::open(const std::string &path, const std::string &password)
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)
+{
clearStatus();
m_errorString.clear();
if (seed.empty()) {
@@ -590,7 +605,7 @@ bool WalletImpl::recover(const std::string &path, const std::string &seed)
try {
m_wallet->set_seed_language(old_language);
- m_wallet->generate(path, "", recovery_key, true, false);
+ m_wallet->generate(path, password, recovery_key, true, false);
} catch (const std::exception &e) {
m_status = Status_Critical;