diff options
author | luigi1111 <luigi1111w@gmail.com> | 2021-07-27 16:56:09 -0400 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2021-07-27 16:56:09 -0400 |
commit | 62bcdc1d3c79496dbffa64e191cc5486f4d83cd2 (patch) | |
tree | cdd6edf449ba804d1b97946f06fe97b165bdce1e /src/device/device_ledger.cpp | |
parent | Merge pull request #7740 (diff) | |
parent | ledger: use software device if we have view key (diff) | |
download | monero-62bcdc1d3c79496dbffa64e191cc5486f4d83cd2.tar.xz |
Merge pull request #7744
ce40c33 ledger: use software device if we have view key (tobtoht)
Diffstat (limited to 'src/device/device_ledger.cpp')
-rw-r--r-- | src/device/device_ledger.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/device/device_ledger.cpp b/src/device/device_ledger.cpp index 384b776ee..a8ca16b73 100644 --- a/src/device/device_ledger.cpp +++ b/src/device/device_ledger.cpp @@ -518,9 +518,7 @@ namespace hw { } bool device_ledger::init(void) { - #ifdef DEBUG_HWDEVICE this->controle_device = &hw::get_device("default"); - #endif this->release(); hw_device.init(); MDEBUG( "Device "<<this->id <<" HIDUSB inited"); @@ -739,6 +737,12 @@ namespace hw { } crypto::public_key device_ledger::get_subaddress_spend_public_key(const cryptonote::account_keys& keys, const cryptonote::subaddress_index &index) { + if (has_view_key) { + cryptonote::account_keys keys_{keys}; + keys_.m_view_secret_key = this->viewkey; + return this->controle_device->get_subaddress_spend_public_key(keys_, index); + } + AUTO_LOCK_CMD(); crypto::public_key D; @@ -790,6 +794,12 @@ namespace hw { } cryptonote::account_public_address device_ledger::get_subaddress(const cryptonote::account_keys& keys, const cryptonote::subaddress_index &index) { + if (has_view_key) { + cryptonote::account_keys keys_{keys}; + keys_.m_view_secret_key = this->viewkey; + return this->controle_device->get_subaddress(keys_, index); + } + AUTO_LOCK_CMD(); cryptonote::account_public_address address; |