diff options
author | luigi1111 <luigi1111w@gmail.com> | 2019-07-24 14:33:36 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2019-07-24 14:33:36 -0500 |
commit | 5030b8e8aa8de9d4fb75e40be561071b87b57dc8 (patch) | |
tree | a8fabdd63fd9e0e04e759e7d79c74d5ef5822fff /src/simplewallet | |
parent | Merge pull request #5606 (diff) | |
parent | simplewallet: print errors on exceptions creating wallets (diff) | |
download | monero-5030b8e8aa8de9d4fb75e40be561071b87b57dc8.tar.xz |
Merge pull request #5608
c820e18 simplewallet: print errors on exceptions creating wallets (moneromooo-monero)
Diffstat (limited to 'src/simplewallet')
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index f95da1058..fca14c8f8 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -4239,7 +4239,9 @@ boost::optional<tools::password_container> simple_wallet::get_and_verify_passwor boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::program_options::variables_map& vm, const crypto::secret_key& recovery_key, bool recover, bool two_random, const std::string &old_language) { - auto rc = tools::wallet2::make_new(vm, false, password_prompter); + std::pair<std::unique_ptr<tools::wallet2>, tools::password_container> rc; + try { rc = tools::wallet2::make_new(vm, false, password_prompter); } + catch(const std::exception &e) { fail_msg_writer() << tr("Error creating wallet: ") << e.what(); return {}; } m_wallet = std::move(rc.first); if (!m_wallet) { @@ -4334,7 +4336,9 @@ boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::pr const cryptonote::account_public_address& address, const boost::optional<crypto::secret_key>& spendkey, const crypto::secret_key& viewkey) { - auto rc = tools::wallet2::make_new(vm, false, password_prompter); + std::pair<std::unique_ptr<tools::wallet2>, tools::password_container> rc; + try { rc = tools::wallet2::make_new(vm, false, password_prompter); } + catch(const std::exception &e) { fail_msg_writer() << tr("Error creating wallet: ") << e.what(); return {}; } m_wallet = std::move(rc.first); if (!m_wallet) { @@ -4380,7 +4384,9 @@ boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::pr //---------------------------------------------------------------------------------------------------- boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::program_options::variables_map& vm) { - auto rc = tools::wallet2::make_new(vm, false, password_prompter); + std::pair<std::unique_ptr<tools::wallet2>, tools::password_container> rc; + try { rc = tools::wallet2::make_new(vm, false, password_prompter); } + catch(const std::exception &e) { fail_msg_writer() << tr("Error creating wallet: ") << e.what(); return {}; } m_wallet = std::move(rc.first); m_wallet->callback(this); if (!m_wallet) @@ -4421,7 +4427,9 @@ boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::pr boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::program_options::variables_map& vm, const epee::wipeable_string &multisig_keys, const std::string &old_language) { - auto rc = tools::wallet2::make_new(vm, false, password_prompter); + std::pair<std::unique_ptr<tools::wallet2>, tools::password_container> rc; + try { rc = tools::wallet2::make_new(vm, false, password_prompter); } + catch(const std::exception &e) { fail_msg_writer() << tr("Error creating wallet: ") << e.what(); return {}; } m_wallet = std::move(rc.first); if (!m_wallet) { |