diff options
author | Robby Weinberg <wildwobby@wildwobby.com> | 2017-06-03 19:56:51 -0500 |
---|---|---|
committer | Robby Weinberg <wildwobby@wildwobby.com> | 2017-06-03 19:56:51 -0500 |
commit | 71f8249a084c087e1badbad4591829a07fe13b64 (patch) | |
tree | 1b4c893732d85c3982bc042bfdcf020e8f59ffa5 /src/wallet/wallet_errors.h | |
parent | Merge pull request #2059 (diff) | |
download | monero-71f8249a084c087e1badbad4591829a07fe13b64.tar.xz |
Prevent crash if performing certain actions before wallet is initialized
Diffstat (limited to 'src/wallet/wallet_errors.h')
-rw-r--r-- | src/wallet/wallet_errors.h | 10 |
1 files changed, 10 insertions, 0 deletions
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 @@ -177,6 +178,15 @@ namespace tools 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", "file not found", |