diff options
author | glozow <gloriajzhao@gmail.com> | 2022-03-10 10:38:31 +0000 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2022-03-25 11:57:51 +0000 |
commit | 46f2fed6c5e0fa623bfeabf61ba4811d5cf8f47c (patch) | |
tree | f7bfef06c07366f28836701e870b8dbb90d2c5f2 /src/wallet/coinselection.h | |
parent | a44236addd01cff4e4d751e0f379d399fbfc8eae (diff) | |
download | bitcoin-46f2fed6c5e0fa623bfeabf61ba4811d5cf8f47c.tar.xz |
[wallet] remove MIN_CHANGE
Diffstat (limited to 'src/wallet/coinselection.h')
-rw-r--r-- | src/wallet/coinselection.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/wallet/coinselection.h b/src/wallet/coinselection.h index 1da9f86cb5..2e20efa8c1 100644 --- a/src/wallet/coinselection.h +++ b/src/wallet/coinselection.h @@ -13,18 +13,10 @@ #include <optional> namespace wallet { -//! target minimum change amount -static constexpr CAmount MIN_CHANGE{COIN / 100}; -//! final minimum change amount after paying for fees -static const CAmount MIN_FINAL_CHANGE = MIN_CHANGE/2; //! lower bound for randomly-chosen target change amount static constexpr CAmount CHANGE_LOWER{50000}; //! upper bound for randomly-chosen target change amount static constexpr CAmount CHANGE_UPPER{1000000}; -// Ensure that any randomly generated change targets are less than or equal to before. -// Otherwise, tests may fail if funds are not enough to cover change. -static_assert(CHANGE_UPPER <= MIN_CHANGE); -static_assert(CHANGE_LOWER <= MIN_FINAL_CHANGE); /** A UTXO under consideration for use in funding a new transaction. */ class COutput @@ -104,7 +96,7 @@ struct CoinSelectionParams { size_t change_spend_size = 0; /** Mininmum change to target in Knapsack solver: select coins to cover the payment and * at least this value of change. */ - CAmount m_min_change_target{MIN_CHANGE}; + 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. */ |