Permalink
Browse files

Fix crash in view wallets decrypting the null spendkey

  • Loading branch information...
Doy-lee committed Feb 8, 2019
1 parent 31bdf7b commit 3995212be717679566f8fe53d862171a1fa4f5f7
Showing with 20 additions and 4 deletions.
  1. +20 −4 src/wallet/wallet2.cpp
@@ -3824,14 +3824,30 @@ bool wallet2::verify_password(const std::string& keys_file_name, const epee::wip

void wallet2::encrypt_keys(const crypto::chacha_key &key)
{
m_account.encrypt_keys(key);
m_account.decrypt_viewkey(key);
if (m_watch_only)
{
m_account.encrypt_viewkey(key);
m_account.decrypt_viewkey(key);
}
else
{
m_account.encrypt_keys(key);
m_account.decrypt_viewkey(key);
}
}

void wallet2::decrypt_keys(const crypto::chacha_key &key)
{
m_account.encrypt_viewkey(key);
m_account.decrypt_keys(key);
if (m_watch_only)
{
m_account.encrypt_viewkey(key);
m_account.decrypt_viewkey(key);
}
else
{
m_account.encrypt_viewkey(key);
m_account.decrypt_keys(key);
}
}

void wallet2::encrypt_keys(const epee::wipeable_string &password)

0 comments on commit 3995212

Please sign in to comment.