Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#25825: wallet: consolidate CoinSelectionParams:…
Browse files Browse the repository at this point in the history
…:m_change_target and m_min_change_target

acda7e8 [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 acda7e8
  Xekyo:
    ACK acda7e8
  furszy:
    ACK acda7e8
  aureleoules:
    ACK acda7e8.

Tree-SHA512: 4b86171af5d893f7172373bb404bad12c49588ad1e22eb0544c242173f4bc4dede2ff1270c93c9f02f503ab8d9f66b841a8319d0ecb5e896d0fe8727cf03dbf4
  • Loading branch information
achow101 committed Aug 11, 2022
2 parents e5d8b65 + acda7e8 commit 5d294bc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/wallet/coinselection.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/spend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5d294bc

Please sign in to comment.