mirror of
https://github.com/monero-project/monero.git
synced 2024-12-11 07:34:22 -05:00
ledger: use software device if we have view key
This commit is contained in:
parent
d188b5f51f
commit
49beb8da17
@ -529,9 +529,7 @@ namespace hw {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool device_ledger::init(void) {
|
bool device_ledger::init(void) {
|
||||||
#ifdef DEBUG_HWDEVICE
|
|
||||||
this->controle_device = &hw::get_device("default");
|
this->controle_device = &hw::get_device("default");
|
||||||
#endif
|
|
||||||
this->release();
|
this->release();
|
||||||
hw_device.init();
|
hw_device.init();
|
||||||
MDEBUG( "Device "<<this->id <<" HIDUSB inited");
|
MDEBUG( "Device "<<this->id <<" HIDUSB inited");
|
||||||
@ -750,6 +748,12 @@ namespace hw {
|
|||||||
}
|
}
|
||||||
|
|
||||||
crypto::public_key device_ledger::get_subaddress_spend_public_key(const cryptonote::account_keys& keys, const cryptonote::subaddress_index &index) {
|
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();
|
AUTO_LOCK_CMD();
|
||||||
crypto::public_key D;
|
crypto::public_key D;
|
||||||
|
|
||||||
@ -801,6 +805,12 @@ namespace hw {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cryptonote::account_public_address device_ledger::get_subaddress(const cryptonote::account_keys& keys, const cryptonote::subaddress_index &index) {
|
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();
|
AUTO_LOCK_CMD();
|
||||||
cryptonote::account_public_address address;
|
cryptonote::account_public_address address;
|
||||||
|
|
||||||
|
@ -193,10 +193,7 @@ namespace hw {
|
|||||||
crypto::secret_key viewkey;
|
crypto::secret_key viewkey;
|
||||||
bool has_view_key;
|
bool has_view_key;
|
||||||
|
|
||||||
//extra debug
|
|
||||||
#ifdef DEBUG_HWDEVICE
|
|
||||||
device *controle_device;
|
device *controle_device;
|
||||||
#endif
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
device_ledger();
|
device_ledger();
|
||||||
|
Loading…
Reference in New Issue
Block a user