From 71f8249a084c087e1badbad4591829a07fe13b64 Mon Sep 17 00:00:00 2001 From: Robby Weinberg Date: Sat, 3 Jun 2017 19:56:51 -0500 Subject: Prevent crash if performing certain actions before wallet is initialized --- src/wallet/wallet_errors.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/wallet/wallet_errors.h') diff --git a/src/wallet/wallet_errors.h b/src/wallet/wallet_errors.h index 3e3578149..16807e045 100644 --- a/src/wallet/wallet_errors.h +++ b/src/wallet/wallet_errors.h @@ -49,6 +49,7 @@ namespace tools // wallet_runtime_error * // wallet_internal_error // unexpected_txin_type + // wallet_not_initialized // std::logic_error // wallet_logic_error * // file_exists @@ -176,6 +177,15 @@ namespace tools private: cryptonote::transaction m_tx; }; + //---------------------------------------------------------------------------------------------------- + struct wallet_not_initialized : public wallet_internal_error + { + explicit wallet_not_initialized(std::string&& loc) + : wallet_internal_error(std::move(loc), "wallet is not initialized") + { + } + }; + //---------------------------------------------------------------------------------------------------- const char* const file_error_messages[] = { "file already exists", -- cgit v1.2.3