mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
[wallet] remove MIN_CHANGE
This commit is contained in:
parent
a44236addd
commit
46f2fed6c5
3 changed files with 5 additions and 15 deletions
|
|
@ -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. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue