From 195fe2dfb1a14e847a23a1c76a06aef0309525a4 Mon Sep 17 00:00:00 2001 From: Murch Date: Thu, 4 Jan 2024 16:32:50 -0500 Subject: [PATCH] Revert "Print debug messages" This reverts commit d60a73f2544987f6df8045f4e096b855aad82f49. --- src/wallet/coinselection.cpp | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/src/wallet/coinselection.cpp b/src/wallet/coinselection.cpp index 5ddabc6033ea49..6b4c0964cd825e 100644 --- a/src/wallet/coinselection.cpp +++ b/src/wallet/coinselection.cpp @@ -233,9 +233,6 @@ util::Result CoinGrinder(std::vector& utxo_pool, c total_available += utxo_pool[i].GetSelectionAmount(); min_group_weight = std::min(min_group_weight, utxo_pool[i].m_weight); } - - std::cout << "COINGRINDER START | selection_target: " << selection_target << ", change_target: " << change_target << ", utxo_count: " << utxo_pool.size() << std::endl; - if (total_available < selection_target + change_target) { // Insufficient funds return util::Error(); @@ -305,16 +302,9 @@ util::Result CoinGrinder(std::vector& utxo_pool, c ++curr_try; ++next_utxo; - std::cout << "Current Selection: " << curr_amount << " from ["; - for (auto index : curr_selection) { - std::cout << index << ", " ; - } - std::cout << "]" << std::endl; - if (curr_amount + lookahead[curr_selection.back()] < selection_target + change_target) { // Insufficient funds with lookahead: CUT should_cut = true; - std::cout << "Insufficient funds in lookahead" << std::endl; } else if (curr_weight > best_selection_weight) { // best_selection_weight is initialized to max_weight if (curr_weight > max_weight) max_tx_weight_exceeded = true; @@ -322,61 +312,42 @@ util::Result CoinGrinder(std::vector& utxo_pool, c // CUT if last selected group had minimal weight, else SHIFT if (utxo_pool[curr_selection.back()].m_weight <= min_tail_weight[curr_selection.back()]) { should_cut = true; - std::cout << "Best weight exceeded with min_weight" << std::endl; } else { should_shift = true; - std::cout << "Best weight exceeded with bigger weight" << std::endl; } } else if (curr_amount >= selection_target + change_target) { // Potential solution, adding more weight cannot be better: SHIFT should_shift = true; - std::cout << "Potential solution" << std::endl; if (curr_weight < best_selection_weight || curr_amount < best_selection_amount) { best_selection = curr_selection; best_selection_weight = curr_weight; best_selection_amount = curr_amount; - std::cout << "NEW BEST!" << std::endl; } } if (next_utxo == utxo_pool.size()) { // Reached end of UTXO pool, nothing left to add: CUT should_cut = true; - std::cout << "Reached end of utxo pool, cutting" << std::endl; } if (should_cut) { deselect_last(); should_shift = true; should_cut = false; - std::cout << "CUT | "; - std::cout << "Current Selection: " << curr_amount << " from ["; - for (auto index : curr_selection) { - std::cout << index << ", " ; - } - std::cout << "]" << std::endl; } if (should_shift) { // Set `next_utxo` to one after last selected, deselect last selected UTXO, fallthrough to ADD if (curr_selection.empty()) { is_done = true; - std::cout << "Empty set in SHIFT, DONE" << std::endl; result.SetAlgoCompleted(is_done); break; } next_utxo = curr_selection.back() + 1; deselect_last(); should_shift = false; - std::cout << "SHIFT"; - std::cout << "Current Selection: " << curr_amount << " from ["; - for (auto index : curr_selection) { - std::cout << index << ", " ; - } - std::cout << "]" << std::endl; } if (curr_try >= TOTAL_TRIES || is_done) { // Solution is not guaranteed to be optimal if `curr_try` hit TOTAL_TRIES - std::cout << "DONE: total tries " << curr_try << std::endl; result.SetAlgoCompleted(is_done); break; } @@ -388,18 +359,15 @@ util::Result CoinGrinder(std::vector& utxo_pool, c if (next_utxo < utxo_pool.size() - 1) { // Skip if previous UTXO is equivalent and unselected ++next_utxo; - std::cout << "Skipping clone, next_utxo: " << next_utxo << std::endl; } else { // "Skipping" end of branch: SHIFT instead if (curr_selection.empty()) { is_done = true; result.SetAlgoCompleted(is_done); - std::cout << "Empty selection in clone shifting--- DONE: total tries " << curr_try << std::endl; break; } next_utxo = curr_selection.back() + 1; deselect_last(); - std::cout << "Skipping clone reached end of utxo pool, SHIFT" << std::endl; } } }