fixed wallet API regression on spend+view key access

This commit is contained in:
Some Random Crypto Guy
2025-10-09 14:25:26 +01:00
parent 3b00a41fff
commit f60b7209f8

View File

@@ -893,7 +893,8 @@ std::string WalletImpl::integratedAddress(const std::string &payment_id, bool ca
std::string WalletImpl::secretViewKey() const
{
if (m_wallet->use_fork_rules(HF_VERSION_CARROT, 0))
uint32_t hf_version = m_wallet->estimate_current_hard_fork();
if (hf_version >= HF_VERSION_CARROT)
return epee::string_tools::pod_to_hex(unwrap(unwrap(m_wallet->get_account().get_keys().k_view_incoming)));
else
return epee::string_tools::pod_to_hex(unwrap(unwrap(m_wallet->get_account().get_keys().m_view_secret_key)));
@@ -901,7 +902,8 @@ std::string WalletImpl::secretViewKey() const
std::string WalletImpl::publicViewKey() const
{
if (m_wallet->use_fork_rules(HF_VERSION_CARROT, 0))
uint32_t hf_version = m_wallet->estimate_current_hard_fork();
if (hf_version >= HF_VERSION_CARROT)
return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_carrot_account_address.m_view_public_key);
else
return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_account_address.m_view_public_key);
@@ -914,7 +916,8 @@ std::string WalletImpl::secretSpendKey() const
std::string WalletImpl::publicSpendKey() const
{
if (m_wallet->use_fork_rules(HF_VERSION_CARROT, 0))
uint32_t hf_version = m_wallet->estimate_current_hard_fork();
if (hf_version >= HF_VERSION_CARROT)
return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_carrot_account_address.m_spend_public_key);
else
return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_account_address.m_spend_public_key);