diff options
author | Dusan Klinec <dusan.klinec@gmail.com> | 2018-09-27 00:43:13 +0200 |
---|---|---|
committer | Dusan Klinec <dusan.klinec@gmail.com> | 2018-09-27 00:58:47 +0200 |
commit | 06d05c21eb2eb30c7d04b806b1edea09fad51286 (patch) | |
tree | d23c2fb6da2eeed6e4f1d3b3548c8b8a6a384b9f /src | |
parent | Merge pull request #4423 (diff) | |
download | monero-06d05c21eb2eb30c7d04b806b1edea09fad51286.tar.xz |
device: set device name correctly if key_on_device is set
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/wallet2.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 75178845a..b6a172ef0 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -3282,9 +3282,16 @@ bool wallet2::load_keys(const std::string& keys_file_name, const epee::wipeable_ encrypted_secret_keys = field_encrypted_secret_keys; GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, device_name, std::string, String, false, std::string()); - if (m_device_name.empty() && field_device_name_found) + if (m_device_name.empty()) { - m_device_name = field_device_name; + if (field_device_name_found) + { + m_device_name = field_device_name; + } + else + { + m_device_name = m_key_device_type == hw::device::device_type::LEDGER ? "Ledger" : "default"; + } } } else |