From 66fbe640efa81b9c29b2cec4be3ee01848e43943 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Tue, 31 Oct 2023 19:53:26 +0100 Subject: [PATCH] fixed few compilation issues - 2 --- src/wallet/wallet2.cpp | 11 ----------- src/wallet/wallet2.h | 2 -- src/wallet/wallet2_base.h | 14 ++++++++++++-- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 0d1c3e6c..fa91f698 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -132,17 +132,6 @@ std::string wallet2::transfer_flags_to_str(uint32_t flags) result[4] = 'c'; return result; } -//---------------------------------------------------------------------------------------------------- -uint64_t transfer_details_base_to_amount(const transfer_details_base& tdb) -{ - return tdb.amount(); -} -//---------------------------------------------------------------------------------------------------- -std::string transfer_details_base_to_tx_hash(const transfer_details_base& tdb) -{ - return epee::string_tools::pod_to_hex(currency::get_transaction_hash(tdb.m_ptx_wallet_info->m_tx)); -} - //---------------------------------------------------------------------------------------------------- void wallet2::init(const std::string& daemon_address) { diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index 8c2974f3..2b782d1e 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -226,8 +226,6 @@ namespace tools static std::string transfer_flags_to_str(uint32_t flags); - static uint64_t transfer_details_base_to_amount(const transfer_details_base& tdb); - static std::string transfer_details_base_to_tx_hash(const transfer_details_base& tdb); struct mining_context : public currency::pos_mining_context { diff --git a/src/wallet/wallet2_base.h b/src/wallet/wallet2_base.h index 8839c022..fa6eb9ef 100644 --- a/src/wallet/wallet2_base.h +++ b/src/wallet/wallet2_base.h @@ -321,6 +321,16 @@ namespace tools THROW_IF_TRUE_WALLET_INT_ERR_EX_NO_HANDLER(false, "transform_value_to_ptr shoruld never be called"); return std::shared_ptr(); } + //---------------------------------------------------------------------------------------------------- + inline uint64_t transfer_details_base_to_amount(const transfer_details_base& tdb) + { + return tdb.amount(); + } + //---------------------------------------------------------------------------------------------------- + inline std::string transfer_details_base_to_tx_hash(const transfer_details_base& tdb) + { + return epee::string_tools::pod_to_hex(currency::get_transaction_hash(tdb.m_ptx_wallet_info->m_tx)); + } } @@ -386,8 +396,8 @@ namespace tools KV_SERIALIZE(m_flags) KV_SERIALIZE(m_amount) KV_SERIALIZE_N(m_zc_info_ptr, "zc_out_info") - KV_SERIALIZE_EPHEMERAL_N(uint64_t, tools::transfer_details_base_to_amount, "amount") - KV_SERIALIZE_EPHEMERAL_N(std::string, tools::transfer_details_base_to_tx_hash, "tx_id") + KV_SERIALIZE_EPHEMERAL_N(uint64_t, detail::transfer_details_base_to_amount, "amount") + KV_SERIALIZE_EPHEMERAL_N(std::string, detail::transfer_details_base_to_tx_hash, "tx_id") END_KV_SERIALIZE_MAP() BEGIN_BOOST_SERIALIZATION()