From 45404ecc719b916c217938f9e82ad352a4068d12 Mon Sep 17 00:00:00 2001 From: Some Random Crypto Guy Date: Tue, 7 Oct 2025 15:12:49 +0100 Subject: [PATCH] API fixes --- src/wallet/api/pending_transaction.cpp | 8 ++++---- src/wallet/api/wallet.cpp | 17 +++++++---------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/wallet/api/pending_transaction.cpp b/src/wallet/api/pending_transaction.cpp index cfc6d1b5e..4af73ef14 100644 --- a/src/wallet/api/pending_transaction.cpp +++ b/src/wallet/api/pending_transaction.cpp @@ -166,10 +166,10 @@ uint64_t PendingTransactionImpl::amount() const { uint64_t result = 0; for (const auto &ptx : m_pending_tx) { - if (ptx.m_tx.type == cryptonote::transaction_type::AUDIT || - ptx.m_tx.type == cryptonote::transaction_type::BURN || - ptx.m_tx.type == cryptonote::transaction_type::STAKE) { - result += ptx.m_tx.amount_burnt; + if (ptx.tx.type == cryptonote::transaction_type::AUDIT || + ptx.tx.type == cryptonote::transaction_type::BURN || + ptx.tx.type == cryptonote::transaction_type::STAKE) { + result += ptx.tx.amount_burnt; } else { for (const auto &dest : ptx.dests) { result += dest.amount; diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index 60085177d..41f4b53f0 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -893,8 +893,7 @@ std::string WalletImpl::integratedAddress(const std::string &payment_id, bool ca std::string WalletImpl::secretViewKey() const { - uint32_t hf_version = m_wallet->estimate_current_hard_fork(); - if (hf_version >= HF_VERSION_CARROT) + if (m_wallet->use_fork_rules(HF_VERSION_CARROT, 0)) 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))); @@ -902,8 +901,7 @@ std::string WalletImpl::secretViewKey() const std::string WalletImpl::publicViewKey() const { - uint32_t hf_version = m_wallet->estimate_current_hard_fork(); - if (hf_version >= HF_VERSION_CARROT) + if (m_wallet->use_fork_rules(HF_VERSION_CARROT, 0)) 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); @@ -916,8 +914,7 @@ std::string WalletImpl::secretSpendKey() const std::string WalletImpl::publicSpendKey() const { - uint32_t hf_version = m_wallet->estimate_current_hard_fork(); - if (hf_version >= HF_VERSION_CARROT) + if (m_wallet->use_fork_rules(HF_VERSION_CARROT, 0)) 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); @@ -935,22 +932,22 @@ std::string WalletImpl::publicMultisigSignerKey() const std::string WalletImpl::secretViewBalance() const { - return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().s_view_balance; + return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().s_view_balance); } std::string WalletImpl::secretProveSpend() const { - return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().k_prove_spend; + return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().k_prove_spend); } std::string WalletImpl::secretGenerateAddress() const { - return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().s_generate_address; + return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().s_generate_address); } std::string WalletImpl::secretGenerateImage() const { - return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().k_generate_image; + return epee::string_tools::pod_to_hex(m_wallet->get_account().get_keys().k_generate_image); } std::string WalletImpl::path() const