aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorThomas Winget <tewinget@gmail.com>2014-06-06 14:18:11 -0400
committerThomas Winget <tewinget@gmail.com>2014-06-12 19:05:51 -0400
commitd22e458c6c680f4b5dcf56a58a37a5f79912e65c (patch)
tree05a150051c892903c87d913dddf321996c035079 /src/wallet
parentmissing '.at' on two map calls. built on some machines, very strange... (diff)
downloadmonero-d22e458c6c680f4b5dcf56a58a37a5f79912e65c.tar.xz
builds, but doesn't link. other than that, electrum-style recovery implemented (but not tested\!)
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/wallet2.cpp5
-rw-r--r--src/wallet/wallet2.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index b0c341615..59e1b0fa4 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -436,7 +436,7 @@ void wallet2::load_keys(const std::string& keys_file_name, const std::string& pa
THROW_WALLET_EXCEPTION_IF(!r, error::invalid_password);
}
//----------------------------------------------------------------------------------------------------
-void wallet2::generate(const std::string& wallet_, const std::string& password, const crypto::secret_key& recovery_param, bool recover)
+crypto::secret_key wallet2::generate(const std::string& wallet_, const std::string& password, const crypto::secret_key& recovery_param, bool recover)
{
clear();
prepare_file_names(wallet_);
@@ -445,7 +445,7 @@ void wallet2::generate(const std::string& wallet_, const std::string& password,
THROW_WALLET_EXCEPTION_IF(boost::filesystem::exists(m_wallet_file, ignored_ec), error::file_exists, m_wallet_file);
THROW_WALLET_EXCEPTION_IF(boost::filesystem::exists(m_keys_file, ignored_ec), error::file_exists, m_keys_file);
- m_account.generate(recovery_param, recover);
+ crypto::secret_key retval = m_account.generate(recovery_param, recover);
m_account_public_address = m_account.get_keys().m_account_address;
@@ -456,6 +456,7 @@ void wallet2::generate(const std::string& wallet_, const std::string& password,
if(!r) LOG_PRINT_RED_L0("String with address text not saved");
store();
+ return retval;
}
//----------------------------------------------------------------------------------------------------
void wallet2::wallet_exists(const std::string& file_path, bool& keys_file_exists, bool& wallet_file_exists)
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h
index 85ed344c3..f54045b3a 100644
--- a/src/wallet/wallet2.h
+++ b/src/wallet/wallet2.h
@@ -97,7 +97,7 @@ namespace tools
END_SERIALIZE()
};
- void generate(const std::string& wallet, const std::string& password, const crypto::secret_key& recovery_param = crypto::secret_key(), bool recover = false);
+ crypto::secret_key generate(const std::string& wallet, const std::string& password, const crypto::secret_key& recovery_param = crypto::secret_key(), bool recover = false);
void load(const std::string& wallet, const std::string& password);
void store();
cryptonote::account_base& get_account(){return m_account;}