From 218d2735c578b7b005665f56d4dc0890432fa15b Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Wed, 12 Oct 2022 21:36:13 +0200 Subject: [PATCH] more logs, more logs, more logs --- src/wallet/wallet2.cpp | 35 +++++++++++++++++++++++++++++++++-- src/wallet/wallet2.h | 3 +++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 7e0a8db2..7d094d86 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -5661,6 +5661,9 @@ void wallet2::prepare_tx_destinations(uint64_t needed_money, const std::vector& dsts, std::vector& final_detinations, const crypto::hash& asset_id) { + //&&&&& + LOG_PRINT_MAGENTA("[-->prepare_tx_destinations[asset_id="<< asset_id <<"]] needed_money " << needed_money, LOG_LEVEL_0); + currency::tx_destination_entry change_dts = AUTO_VAL_INIT(change_dts); if (needed_money < found_money) { @@ -5678,11 +5681,28 @@ void wallet2::prepare_tx_destinations(uint64_t needed_money, return; } + //&&&&& + //LOG_PRINT_MAGENTA("[--prepare_tx_destinations[asset_id=" << asset_id << "]] needed_money " << needed_money, LOG_LEVEL_0); + + //&&&&& + for (const auto& d : dsts) + { + LOG_PRINT_MAGENTA("[--prepare_tx_destinations::before split] amount:" << d.amount << ", asset_id:" << d.asset_id, LOG_LEVEL_0); + } + uint64_t dust = 0; bool r = detail::apply_split_strategy_by_id(destination_split_strategy_id, dsts, change_dts, dust_policy.dust_threshold, final_detinations, dust, WALLET_MAX_ALLOWED_OUTPUT_AMOUNT); WLT_THROW_IF_FALSE_WALLET_INT_ERR_EX(r, "invalid split strategy id: " << destination_split_strategy_id); WLT_THROW_IF_FALSE_WALLET_INT_ERR_EX(dust_policy.dust_threshold >= dust, "invalid dust value: dust = " << dust << ", dust_threshold = " << dust_policy.dust_threshold); + //&&&&& + for (const auto& d : final_detinations) + { + LOG_PRINT_MAGENTA("[--prepare_tx_destinations::after split] amount:" << d.amount << ", asset_id:" << d.asset_id, LOG_LEVEL_0); + } + + + //@#@ #ifdef _DEBUG if (final_detinations.size() > 10) @@ -5747,14 +5767,25 @@ void wallet2::prepare_transaction(construct_tx_param& ctp, currency::finalize_tx } TIME_MEASURE_FINISH_MS(prepare_tx_sources_time); + //&&&&& + for (const auto& d : ctp.dsts) + { + LOG_PRINT_MAGENTA("[pre-prepare_tx_destinations] amount:" << d.amount << ", asset_id:" << d.asset_id, LOG_LEVEL_0); + } + //&&&&& + for (const auto& d : needed_money_map) + { + LOG_PRINT_MAGENTA("[pre-prepare_tx_destinations] needed_money_map key: " << d.first << ", needed amount: " << d.second.needed_amount, LOG_LEVEL_0); + } + TIME_MEASURE_START_MS(prepare_tx_destinations_time); prepare_tx_destinations(needed_money_map, static_cast(ctp.split_strategy_id), ctp.dust_policy, ctp.dsts, ftp.prepared_destinations); TIME_MEASURE_FINISH_MS(prepare_tx_destinations_time); //&&&&& - for (const auto d : ftp.prepared_destinations) + for (const auto& d : ftp.prepared_destinations) { - LOG_PRINT_MAGENTA("[prepare_tx_destinations] amount:" << d.amount << ", asset_id:" << d.asset_id, LOG_LEVEL_0); + LOG_PRINT_MAGENTA("[post-prepare_tx_destinations] amount:" << d.amount << ", asset_id:" << d.asset_id, LOG_LEVEL_0); } diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index 5d0f02a6..f05d6d8a 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -252,6 +252,9 @@ namespace tools const currency::tx_destination_entry& change_dst, uint64_t dust_threshold, std::vector& splitted_dsts, uint64_t& dust, uint64_t max_output_allowed) { + //&&&&& + LOG_PRINT_MAGENTA("[--apply_split_strategy_by_id, split strtegy_id: " << id, LOG_LEVEL_0); + switch (id) { case ssi_digit: