aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2022-08-11 14:53:48 -0400
committerAndrew Chow <achow101-github@achow101.com>2022-08-11 15:04:13 -0400
commit5d294bccbae51b21e10caf5d699a401f69462184 (patch)
tree54f1354eec09e7bb81989dac9c1a84199ea9e4ea
parente5d8b654239789d2302bee3eb55d37ec1a3339e6 (diff)
parentacda7e8686a1f7a967d6331a2f6a3a01389c3048 (diff)
downloadbitcoin-5d294bccbae51b21e10caf5d699a401f69462184.tar.xz
Merge bitcoin/bitcoin#25825: wallet: consolidate CoinSelectionParams::m_change_target and m_min_change_target
acda7e8686a1f7a967d6331a2f6a3a01389c3048 [coin selection] consolidate m_change_target and m_min_change_target (glozow) Pull request description: These values are both intended for the same thing. Their divergence seems to be the result of an incomplete rename. ACKs for top commit: achow101: ACK acda7e8686a1f7a967d6331a2f6a3a01389c3048 Xekyo: ACK acda7e8686a1f7a967d6331a2f6a3a01389c3048 furszy: ACK acda7e86 aureleoules: ACK acda7e8686a1f7a967d6331a2f6a3a01389c3048. Tree-SHA512: 4b86171af5d893f7172373bb404bad12c49588ad1e22eb0544c242173f4bc4dede2ff1270c93c9f02f503ab8d9f66b841a8319d0ecb5e896d0fe8727cf03dbf4
-rw-r--r--src/wallet/coinselection.h2
-rw-r--r--src/wallet/spend.cpp2
2 files changed, 1 insertions, 3 deletions
diff --git a/src/wallet/coinselection.h b/src/wallet/coinselection.h
index 9135e48104..e257d3f7c7 100644
--- a/src/wallet/coinselection.h
+++ b/src/wallet/coinselection.h
@@ -125,8 +125,6 @@ struct CoinSelectionParams {
CAmount m_min_change_target{0};
/** Cost of creating the change output. */
CAmount m_change_fee{0};
- /** The pre-determined minimum value to target when funding a change output. */
- CAmount m_change_target{0};
/** Cost of creating the change output + cost of spending the change output in the future. */
CAmount m_cost_of_change{0};
/** The targeted feerate of the transaction being built. */
diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp
index e266cf6c81..61d86844df 100644
--- a/src/wallet/spend.cpp
+++ b/src/wallet/spend.cpp
@@ -794,7 +794,7 @@ static util::Result<CreatedTransactionResult> CreateTransactionInternal(
coin_selection_params.m_subtract_fee_outputs = true;
}
}
- coin_selection_params.m_change_target = GenerateChangeTarget(std::floor(recipients_sum / vecSend.size()), rng_fast);
+ coin_selection_params.m_min_change_target = GenerateChangeTarget(std::floor(recipients_sum / vecSend.size()), rng_fast);
// Create change script that will be used if we need change
CScript scriptChange;