diff options
author | Riccardo Spagni <ric@spagni.net> | 2014-12-13 13:51:39 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2014-12-13 13:51:42 +0200 |
commit | c1bf8fb94b217f9ec63ac484991fa48271ad93b3 (patch) | |
tree | 20074996b1adccefc9afde6231f8bcd0afc842e6 /src/wallet/wallet2.cpp | |
parent | Merge pull request #200 (diff) | |
parent | wallet2::load correctly initialize m_blockchain for wallet loaded without bin... (diff) | |
download | monero-c1bf8fb94b217f9ec63ac484991fa48271ad93b3.tar.xz |
Merge pull request #201
9b7e0a0 wallet2::load correctly initialize m_blockchain for wallet loaded without bin file (warptangent)
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r-- | src/wallet/wallet2.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index cbf0ac4be..e55ad5a58 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -734,14 +734,16 @@ void wallet2::load(const std::string& wallet_, const std::string& password) { LOG_PRINT_L0("file not found: " << m_wallet_file << ", starting with empty blockchain"); m_account_public_address = m_account.get_keys().m_account_address; - return; } - bool r = tools::unserialize_obj_from_file(*this, m_wallet_file); - THROW_WALLET_EXCEPTION_IF(!r, error::file_read_error, m_wallet_file); - THROW_WALLET_EXCEPTION_IF( - m_account_public_address.m_spend_public_key != m_account.get_keys().m_account_address.m_spend_public_key || - m_account_public_address.m_view_public_key != m_account.get_keys().m_account_address.m_view_public_key, - error::wallet_files_doesnt_correspond, m_keys_file, m_wallet_file); + else + { + bool r = tools::unserialize_obj_from_file(*this, m_wallet_file); + THROW_WALLET_EXCEPTION_IF(!r, error::file_read_error, m_wallet_file); + THROW_WALLET_EXCEPTION_IF( + m_account_public_address.m_spend_public_key != m_account.get_keys().m_account_address.m_spend_public_key || + m_account_public_address.m_view_public_key != m_account.get_keys().m_account_address.m_view_public_key, + error::wallet_files_doesnt_correspond, m_keys_file, m_wallet_file); + } cryptonote::block genesis; generate_genesis(genesis); |