From 8101bc493242dabb790f27f2dcf6e82bd2703843 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Wed, 24 Jul 2019 23:32:41 +0200 Subject: [PATCH] fixed compilation issues in wallet --- src/currency_core/currency_boost_serialization.h | 5 +++++ src/wallet/wallet2.cpp | 6 +++--- src/wallet/wallet2.h | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/currency_core/currency_boost_serialization.h b/src/currency_core/currency_boost_serialization.h index 6802afd4..30e85e92 100644 --- a/src/currency_core/currency_boost_serialization.h +++ b/src/currency_core/currency_boost_serialization.h @@ -190,6 +190,11 @@ namespace boost a & at.v; } template + inline void serialize(Archive &a, currency::etc_tx_details_unlock_time2 &at, const boost::serialization::version_type ver) + { + a & at.unlock_time_array; + } + template inline void serialize(Archive &a, currency::etc_tx_details_expiration_time &at, const boost::serialization::version_type ver) { a & at.v; diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index ca011d3c..e793e093 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -35,7 +35,7 @@ namespace tools { //--------------------------------------------------------------- - uint64_t wallet2::get_max_unlock_time_from_receive_indices(const currency::transaction& tx, const tools::money_transfer2_details& td) + uint64_t wallet2::get_max_unlock_time_from_receive_indices(const currency::transaction& tx, const tools::wallet_rpc::wallet_transfer_info_details& td) { uint64_t max_unlock_time = 0; // etc_tx_details_expiration_time have priority over etc_tx_details_expiration_time2 @@ -50,7 +50,7 @@ namespace tools CHECK_AND_ASSERT_THROW_MES(ut2.unlock_time_array.size() == tx.vout.size(), "Internal error: wrong tx transfer details: ut2.unlock_time_array.size()" << ut2.unlock_time_array.size() << " is not equal transaction outputs vector size=" << tx.vout.size()); - for (auto ri : td.receive_indices) + for (auto ri : td.rcv) { CHECK_AND_ASSERT_THROW_MES(ri < tx.vout.size(), "Internal error: wrong tx transfer details: reciev index=" << ri << " is greater than transaction outputs vector " << tx.vout.size()); if (tx.vout[ri].target.type() == typeid(currency::txout_to_key)) @@ -960,7 +960,7 @@ void wallet2::prepare_wti(wallet_rpc::wallet_transfer_info& wti, uint64_t height wti.amount = amount; wti.height = height; fill_transfer_details(tx, td, wti.td); - wti.unlock_time = get_max_unlock_time_from_receive_indices(tx, td); + wti.unlock_time = get_max_unlock_time_from_receive_indices(tx, wti.td); wti.timestamp = timestamp; wti.fee = currency::is_coinbase(tx) ? 0:currency::get_tx_fee(tx); wti.tx_blob_size = static_cast(currency::get_object_blobsize(wti.tx)); diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index 815d7129..0f5e079a 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -721,7 +721,7 @@ namespace tools void finalize_transaction(const finalize_tx_param& ftp, currency::transaction& tx, crypto::secret_key& tx_key, bool broadcast_tx); std::string get_log_prefix() const { return m_log_prefix; } - static uint64_t get_max_unlock_time_from_receive_indices(const currency::transaction& tx, const tools::money_transfer2_details& td); + static uint64_t get_max_unlock_time_from_receive_indices(const currency::transaction& tx, const tools::wallet_rpc::wallet_transfer_info_details& td); private: void add_transfers_to_expiration_list(const std::vector& selected_transfers, uint64_t expiration, uint64_t change_amount, const crypto::hash& related_tx_id); void remove_transfer_from_expiration_list(uint64_t transfer_index); @@ -956,7 +956,7 @@ namespace boost //do not store this items in the file since it's quite easy to restore it from original tx if (Archive::is_loading::value) { - x.unlock_time = wallet::get_max_unlock_time_from_receive_indices(x.tx, x.td) + x.unlock_time = tools::wallet2::get_max_unlock_time_from_receive_indices(x.tx, x.td); x.is_service = currency::is_service_tx(x.tx); x.is_mixing = currency::is_mixin_tx(x.tx); x.is_mining = currency::is_coinbase(x.tx);