aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authorwarptangent <warptangent@inbox.com>2014-12-10 02:38:35 -0800
committerwarptangent <warptangent@inbox.com>2014-12-10 02:42:15 -0800
commit9b7e0a06b5835fe4ca619796bcf7f52612651687 (patch)
tree662f3c6d223f6f79e37bd526e89797ffb0f3e60b /src/wallet/wallet2.cpp
parentversion bump to 0.8.8.6 (diff)
downloadmonero-9b7e0a06b5835fe4ca619796bcf7f52612651687.tar.xz
wallet2::load correctly initialize m_blockchain for wallet loaded without bin file
Fix for simplewallet loading a wallet with a keys file but no bin file. - this situation previously required a user to restart simplewallet before it would refresh its blockchain from the server.
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r--src/wallet/wallet2.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 163e19df4..b0605e20e 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -686,14 +686,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);