diff --git a/src/simplewallet/password_container.cpp b/src/simplewallet/password_container.cpp index db34b2b64..0067b23d1 100644 --- a/src/simplewallet/password_container.cpp +++ b/src/simplewallet/password_container.cpp @@ -60,6 +60,14 @@ namespace tools } + password_container::password_container(std::string&& password) + : m_empty(false) + , m_password(std::move(password)) + , m_verify(false) + { + + } + password_container::password_container(password_container&& rhs) : m_empty(std::move(rhs.m_empty)) diff --git a/src/simplewallet/password_container.h b/src/simplewallet/password_container.h index 22a86db79..62f43aa37 100644 --- a/src/simplewallet/password_container.h +++ b/src/simplewallet/password_container.h @@ -41,6 +41,7 @@ namespace tools static const size_t max_password_size = 1024; password_container(bool verify); password_container(password_container&& rhs); + password_container(std::string&& password); ~password_container(); void clear(); diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 7b6e3a04d..ad55f2fb0 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -468,6 +468,7 @@ bool simple_wallet::set_default_mixin(const std::vector &args/* = s verify=true; tools::password_container pwd_container(verify); + success = pwd_container.read_password(); if (!success) { @@ -882,7 +883,7 @@ bool simple_wallet::ask_wallet_create_if_needed() bool r; if(keys_file_exists) { - m_wallet_file = wallet_path; + m_wallet_file=wallet_path; r = true; }else { @@ -1107,7 +1108,7 @@ bool simple_wallet::generate_from_json(const boost::program_options::variables_m } } - m_wallet_file = field_filename; + m_wallet_file=field_filename; bool was_deprecated_wallet = m_restore_deterministic_wallet && ((old_language == crypto::ElectrumWords::old_language_name) || crypto::ElectrumWords::get_is_old_style_seed(m_electrum_seed)); @@ -1335,7 +1336,7 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm) } crypto::secret_key viewkey = *reinterpret_cast(viewkey_data.data()); - m_wallet_file = m_generate_from_view_key; + m_wallet_file= m_generate_from_view_key; // check the view key matches the given address crypto::public_key pkey; @@ -1402,7 +1403,7 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm) } crypto::secret_key viewkey = *reinterpret_cast(viewkey_data.data()); - m_wallet_file = m_generate_from_keys; + m_wallet_file=m_generate_from_keys; // check the spend and view keys match the given address crypto::public_key pkey; @@ -1564,7 +1565,8 @@ bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string return false; } - m_wallet_file = wallet_file; + + m_wallet_file=wallet_file; m_wallet.reset(new tools::wallet2(testnet)); m_wallet->callback(this); @@ -1623,7 +1625,7 @@ bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string& password, const cryptonote::account_public_address& address, const crypto::secret_key& viewkey, bool testnet) { - m_wallet_file = wallet_file; + m_wallet_file=wallet_file; m_wallet.reset(new tools::wallet2(testnet)); m_wallet->callback(this); @@ -1651,7 +1653,7 @@ bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string& password, const cryptonote::account_public_address& address, const crypto::secret_key& spendkey, const crypto::secret_key& viewkey, bool testnet) { - m_wallet_file = wallet_file; + m_wallet_file=wallet_file; m_wallet.reset(new tools::wallet2(testnet)); m_wallet->callback(this); @@ -1683,7 +1685,7 @@ bool simple_wallet::open_wallet(const string &wallet_file, const std::string& pa return false; } - m_wallet_file = wallet_file; + m_wallet_file=wallet_file; m_wallet.reset(new tools::wallet2(testnet)); m_wallet->callback(this);