API fixes

This commit is contained in:
Some Random Crypto Guy
2025-10-07 15:12:49 +01:00
parent e5bfc2f6ad
commit 45404ecc71
2 changed files with 11 additions and 14 deletions
+4 -4
View File
@@ -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;
+7 -10
View File
@@ -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