From 84c0697f1c349172bfecc6a62b53ae171ea74609 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Thu, 16 Jun 2022 17:33:37 +0200 Subject: [PATCH] renamed alias member to proper name - fixed in wallet --- src/simplewallet/simplewallet.cpp | 4 ++-- src/wallet/wallet2.cpp | 22 +++++++++++----------- src/wallet/wallet2.h | 2 +- tests/core_tests/wallet_tests.cpp | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 1cc8d064..7f4ab1b0 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -774,9 +774,9 @@ bool print_wti(const tools::wallet_public::wallet_transfer_info& wti) static const std::string separator = ", "; std::string remote_side; - if (!wti.recipients_aliases.empty()) + if (!wti.remote_aliases.empty()) { - for (auto it : wti.recipients_aliases) + for (auto it : wti.remote_aliases) remote_side += remote_side.empty() ? it : (separator + it); } else diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index bbfa5354..02a3267f 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -326,8 +326,8 @@ void wallet2::fetch_tx_global_indixes(const std::list* pglobal_indexes) { - std::vector recipients, recipients_aliases; - process_unconfirmed(tx, recipients, recipients_aliases); + std::vector recipients, remote_aliases; + process_unconfirmed(tx, recipients, remote_aliases); std::vector outs; uint64_t tx_money_got_in_outs = 0; crypto::public_key tx_pub_key = null_pkey; @@ -702,7 +702,7 @@ void wallet2::process_new_transaction(const currency::transaction& tx, uint64_t {//this actually is transfer transaction, notify about spend if (tx_money_spent_in_ins > tx_money_got_in_outs) {//usual transfer - handle_money_spent2(b, tx, tx_money_spent_in_ins - (tx_money_got_in_outs+get_tx_fee(tx)), mtd, recipients, recipients_aliases); + handle_money_spent2(b, tx, tx_money_spent_in_ins - (tx_money_got_in_outs+get_tx_fee(tx)), mtd, recipients, remote_aliases); } else {//strange transfer, seems that in one transaction have transfers from different wallets. @@ -725,7 +725,7 @@ void wallet2::process_new_transaction(const currency::transaction& tx, uint64_t else if (mtd.spent_indices.size()) { // multisig spend detected - handle_money_spent2(b, tx, 0, mtd, recipients, recipients_aliases); + handle_money_spent2(b, tx, 0, mtd, recipients, remote_aliases); } } } @@ -1342,27 +1342,27 @@ void wallet2::handle_money_spent2(const currency::block& b, uint64_t amount, const money_transfer2_details& td, const std::vector& recipients, - const std::vector& recipients_aliases) + const std::vector& remote_aliases) { m_transfer_history.push_back(AUTO_VAL_INIT(wallet_public::wallet_transfer_info())); wallet_public::wallet_transfer_info& wti = m_transfer_history.back(); wti.is_income = false; wti.remote_addresses = recipients; - wti.recipients_aliases = recipients_aliases; + wti.remote_aliases = remote_aliases; prepare_wti(wti, get_block_height(b), get_block_datetime(b), in_tx, amount, td); WLT_LOG_L1("[MONEY SPENT]: " << epee::serialization::store_t_to_json(wti)); rise_on_transfer2(wti); } //---------------------------------------------------------------------------------------------------- -void wallet2::process_unconfirmed(const currency::transaction& tx, std::vector& recipients, std::vector& recipients_aliases) +void wallet2::process_unconfirmed(const currency::transaction& tx, std::vector& recipients, std::vector& remote_aliases) { auto unconf_it = m_unconfirmed_txs.find(get_transaction_hash(tx)); if (unconf_it != m_unconfirmed_txs.end()) { wallet_public::wallet_transfer_info& wti = unconf_it->second; recipients = wti.remote_addresses; - recipients_aliases = wti.recipients_aliases; + remote_aliases = wti.remote_aliases; m_unconfirmed_txs.erase(unconf_it); } @@ -3310,7 +3310,7 @@ void wallet2::get_recent_transfers_history(std::vector= count) @@ -3343,7 +3343,7 @@ void wallet2::wti_to_csv_entry(std::ostream& ss, const wallet_public::wallet_tra ss << wti.tx_blob_size << ","; ss << epee::string_tools::buff_to_hex_nodelimer(wti.payment_id) << ","; ss << "["; - std::copy(wti.recipients_aliases.begin(), wti.recipients_aliases.end(), std::ostream_iterator(ss, " ")); + std::copy(wti.remote_aliases.begin(), wti.remote_aliases.end(), std::ostream_iterator(ss, " ")); ss << "]" << ","; ss << (wti.is_income ? "in" : "out") << ","; ss << (wti.is_service ? "[SERVICE]" : "") << (wti.is_mixing ? "[MIXINS]" : "") << (wti.is_mining ? "[MINING]" : "") << ","; @@ -5177,7 +5177,7 @@ void wallet2::add_sent_unconfirmed_tx(const currency::transaction& tx, //unconfirmed_wti.tx = tx; unconfirmed_wti.remote_addresses = recipients; for (auto addr : recipients) - unconfirmed_wti.recipients_aliases.push_back(get_alias_for_address(addr)); + unconfirmed_wti.remote_aliases.push_back(get_alias_for_address(addr)); unconfirmed_wti.is_income = false; unconfirmed_wti.selected_indicies = selected_indicies; /*TODO: add selected_indicies to read_money_transfer2_details_from_tx in case of performance problems*/ diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index be96f286..bd0c657d 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -1164,7 +1164,7 @@ namespace boost a & x.is_income; a & x.td; a & x.tx; - a & x.recipients_aliases; + a & x.remote_aliases; a & x.comment; a & x.contract; a & x.selected_indicies; diff --git a/tests/core_tests/wallet_tests.cpp b/tests/core_tests/wallet_tests.cpp index b1cea099..ff3e3fb5 100644 --- a/tests/core_tests/wallet_tests.cpp +++ b/tests/core_tests/wallet_tests.cpp @@ -1781,7 +1781,7 @@ bool gen_wallet_alias_via_special_wallet_funcs::c1(currency::core& c, size_t ev_ uint64_t biggest_alias_reward = get_alias_coast_from_fee("a", TESTS_DEFAULT_FEE); std::shared_ptr l(new wlt_lambda_on_transfer2_wrapper( [biggest_alias_reward](const tools::wallet_public::wallet_transfer_info& wti, uint64_t balance, uint64_t unlocked_balance, uint64_t total_mined) -> bool { - return std::count(wti.recipients_aliases.begin(), wti.recipients_aliases.end(), "minerminer") == 1 && + return std::count(wti.remote_aliases.begin(), wti.remote_aliases.end(), "minerminer") == 1 && wti.amount == biggest_alias_reward; } ));