aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Blair <snipa@jagtech.io>2020-08-16 12:51:56 -0700
committerAlexander Blair <snipa@jagtech.io>2020-08-16 12:51:57 -0700
commitf40b9e34e0b74f499f7b8c35fa3acdec7b0fbc1c (patch)
tree6529f3f419f1087e421f7e1da3634ee96f9296b9
parentMerge pull request #6712 (diff)
parentwallet2: throw a error on wallet initialization failure (diff)
downloadmonero-f40b9e34e0b74f499f7b8c35fa3acdec7b0fbc1c.tar.xz
Merge pull request #6715
3d6bc0a68 wallet2: throw a error on wallet initialization failure (xiphon)
-rw-r--r--src/wallet/wallet2.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index f971bbd7a..530bc036f 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -488,7 +488,10 @@ std::unique_ptr<tools::wallet2> make_basic(const boost::program_options::variabl
}
std::unique_ptr<tools::wallet2> wallet(new tools::wallet2(nettype, kdf_rounds, unattended));
- wallet->init(std::move(daemon_address), std::move(login), std::move(proxy), 0, *trusted_daemon, std::move(ssl_options));
+ if (!wallet->init(std::move(daemon_address), std::move(login), std::move(proxy), 0, *trusted_daemon, std::move(ssl_options)))
+ {
+ THROW_WALLET_EXCEPTION(tools::error::wallet_internal_error, tools::wallet2::tr("failed to initialize the wallet"));
+ }
boost::filesystem::path ringdb_path = command_line::get_arg(vm, opts.shared_ringdb_dir);
wallet->set_ring_database(ringdb_path.string());
wallet->get_message_store().set_options(vm);