From baab0d2d43049a71dc90176bc4d72062f7b2ce19 Mon Sep 17 00:00:00 2001 From: ismaelsadeeq Date: Thu, 29 Feb 2024 10:59:50 +0100 Subject: [PATCH] [doc]: update reason for deducting change output weight `CoinGrinder` will also produce change output, listing all the Coin selection algorithms that produces change output is not maintainable, just infer that remaining algorithms all might produce change. --- src/wallet/spend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp index a39a4ca0d1ec0..4759f1eb956fd 100644 --- a/src/wallet/spend.cpp +++ b/src/wallet/spend.cpp @@ -705,7 +705,7 @@ util::Result ChooseSelectionResult(interfaces::Chain& chain, co } else append_error(std::move(bnb_result)); } - // As Knapsack and SRD can create change, also deduce change weight. + // Deduct change weight because remaining Coin Selection algorithms can create change output max_selection_weight -= (coin_selection_params.change_output_size * WITNESS_SCALE_FACTOR); // The knapsack solver has some legacy behavior where it will spend dust outputs. We retain this behavior, so don't filter for positive only here.