device/trezor: HF10 support added, wallet::API

- import only key images generated by cold signing process
- wallet_api: trezor methods added
- wallet: button request code added
- const added to methods
- wallet2::get_tx_key_device() tries to decrypt stored tx private keys using the device.
- simplewallet supports get_tx_key and get_tx_proof on hw device using the get_tx_key feature
- live refresh enables refresh with trezor i.e. computing key images on the fly. More convenient and efficient for users.
- device: has_ki_live_refresh added
- a thread is watching whether live refresh is being computed, if not for 30 seconds, it terminates the live refresh process - switches Trezor state
This commit is contained in:
Dusan Klinec
2019-03-20 21:11:02 +01:00
parent d74d26f2c9
commit a1fd1d499c
19 changed files with 1274 additions and 243 deletions
+17
View File
@@ -109,6 +109,23 @@ bool PendingTransactionImpl::commit(const std::string &filename, bool overwrite)
}
m_wallet.pauseRefresh();
const bool tx_cold_signed = m_wallet.m_wallet->get_account().get_device().has_tx_cold_sign();
if (tx_cold_signed){
std::unordered_set<size_t> selected_transfers;
for(const tools::wallet2::pending_tx & ptx : m_pending_tx){
for(size_t s : ptx.selected_transfers){
selected_transfers.insert(s);
}
}
m_wallet.m_wallet->cold_tx_aux_import(m_pending_tx, m_tx_device_aux);
bool r = m_wallet.m_wallet->import_key_images(m_key_images, 0, selected_transfers);
if (!r){
throw runtime_error("Cold sign transaction submit failed - key image sync fail");
}
}
while (!m_pending_tx.empty()) {
auto & ptx = m_pending_tx.back();
m_wallet.m_wallet->commit_tx(ptx);