Merge pull request #8999

205c804 wallet: store watch-only wallet correctly when change_password() is called (jeff)
This commit is contained in:
luigi1111 2023-09-30 14:44:32 -04:00
commit 41157dbc82
No known key found for this signature in database
GPG key ID: F4ACA0183641E010

View file

@ -4460,7 +4460,7 @@ boost::optional<wallet2::keys_file_data> wallet2::get_keys_file_data(const epee:
value2.SetInt(m_key_device_type);
json.AddMember("key_on_device", value2, json.GetAllocator());
value2.SetInt(watch_only ? 1 :0); // WTF ? JSON has different true and false types, and not boolean ??
value2.SetInt((watch_only || m_watch_only) ? 1 :0); // WTF ? JSON has different true and false types, and not boolean ??
json.AddMember("watch_only", value2, json.GetAllocator());
value2.SetInt(m_multisig ? 1 :0);
@ -6395,7 +6395,7 @@ void wallet2::store_to(const std::string &path, const epee::wipeable_string &pas
if (!same_file || force_rewrite_keys)
{
bool r = store_keys(m_keys_file, password, false);
bool r = store_keys(m_keys_file, password, m_watch_only);
THROW_WALLET_EXCEPTION_IF(!r, error::file_save_error, m_keys_file);
}