mirror of
https://github.com/monero-project/monero.git
synced 2025-08-24 02:15:13 -04:00
Merge pull request #5594
f074b6b
device: show address on device display (ph4r05)
This commit is contained in:
commit
8ae2681e08
12 changed files with 128 additions and 7 deletions
|
@ -10048,6 +10048,7 @@ void wallet2::cold_sign_tx(const std::vector<pending_tx>& ptx_vector, signed_tx_
|
|||
setup_shim(&wallet_shim, this);
|
||||
aux_data.tx_recipients = dsts_info;
|
||||
aux_data.bp_version = use_fork_rules(HF_VERSION_SMALLER_BP, -10) ? 2 : 1;
|
||||
aux_data.hard_fork = get_current_hard_fork();
|
||||
dev_cold->tx_sign(&wallet_shim, txs, exported_txs, aux_data);
|
||||
tx_device_aux = aux_data.tx_device_aux;
|
||||
|
||||
|
@ -10075,6 +10076,35 @@ uint64_t wallet2::cold_key_image_sync(uint64_t &spent, uint64_t &unspent) {
|
|||
return import_res;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
void wallet2::device_show_address(uint32_t account_index, uint32_t address_index, const boost::optional<crypto::hash8> &payment_id)
|
||||
{
|
||||
if (!key_on_device())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto & hwdev = get_account().get_device();
|
||||
hwdev.display_address(subaddress_index{account_index, address_index}, payment_id);
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
uint8_t wallet2::get_current_hard_fork()
|
||||
{
|
||||
if (m_offline)
|
||||
return 0;
|
||||
|
||||
cryptonote::COMMAND_RPC_HARD_FORK_INFO::request req_t = AUTO_VAL_INIT(req_t);
|
||||
cryptonote::COMMAND_RPC_HARD_FORK_INFO::response resp_t = AUTO_VAL_INIT(resp_t);
|
||||
|
||||
m_daemon_rpc_mutex.lock();
|
||||
req_t.version = 0;
|
||||
bool r = net_utils::invoke_http_json_rpc("/json_rpc", "hard_fork_info", req_t, resp_t, m_http_client, rpc_timeout);
|
||||
m_daemon_rpc_mutex.unlock();
|
||||
THROW_WALLET_EXCEPTION_IF(!r, tools::error::no_connection_to_daemon, "hard_fork_info");
|
||||
THROW_WALLET_EXCEPTION_IF(resp_t.status == CORE_RPC_STATUS_BUSY, tools::error::daemon_busy, "hard_fork_info");
|
||||
THROW_WALLET_EXCEPTION_IF(resp_t.status != CORE_RPC_STATUS_OK, tools::error::wallet_generic_rpc_error, "hard_fork_info", m_trusted_daemon ? resp_t.status : "daemon error");
|
||||
return resp_t.version;
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
void wallet2::get_hard_fork_info(uint8_t version, uint64_t &earliest_height) const
|
||||
{
|
||||
boost::optional<std::string> result = m_node_rpc_proxy.get_earliest_height(version, earliest_height);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue