aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r--src/wallet/wallet.h46
1 files changed, 3 insertions, 43 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index fc4edd8d20..5f48e77590 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -612,46 +612,6 @@ public:
}
};
-/** Parameters for one iteration of Coin Selection. */
-struct CoinSelectionParams
-{
- /** Toggles use of Branch and Bound instead of Knapsack solver. */
- bool use_bnb = true;
- /** Size of a change output in bytes, determined by the output type. */
- size_t change_output_size = 0;
- /** Size of the input to spend a change output in virtual bytes. */
- size_t change_spend_size = 0;
- /** The targeted feerate of the transaction being built. */
- CFeeRate m_effective_feerate;
- /** The feerate estimate used to estimate an upper bound on what should be sufficient to spend
- * the change output sometime in the future. */
- CFeeRate m_long_term_feerate;
- /** If the cost to spend a change output at the discard feerate exceeds its value, drop it to fees. */
- CFeeRate m_discard_feerate;
- /** Size of the transaction before coin selection, consisting of the header and recipient
- * output(s), excluding the inputs and change output(s). */
- size_t tx_noinputs_size = 0;
- /** Indicate that we are subtracting the fee from outputs */
- bool m_subtract_fee_outputs = false;
- /** When true, always spend all (up to OUTPUT_GROUP_MAX_ENTRIES) or none of the outputs
- * associated with the same address. This helps reduce privacy leaks resulting from address
- * reuse. Dust outputs are not eligible to be added to output groups and thus not considered. */
- bool m_avoid_partial_spends = false;
-
- CoinSelectionParams(bool use_bnb, size_t change_output_size, size_t change_spend_size, CFeeRate effective_feerate,
- CFeeRate long_term_feerate, CFeeRate discard_feerate, size_t tx_noinputs_size, bool avoid_partial) :
- use_bnb(use_bnb),
- change_output_size(change_output_size),
- change_spend_size(change_spend_size),
- m_effective_feerate(effective_feerate),
- m_long_term_feerate(long_term_feerate),
- m_discard_feerate(discard_feerate),
- tx_noinputs_size(tx_noinputs_size),
- m_avoid_partial_spends(avoid_partial)
- {}
- CoinSelectionParams() {}
-};
-
class WalletRescanReserver; //forward declarations for ScanForWalletTransactions/RescanFromTime
/**
* A CWallet maintains a set of transactions and balances, and provides the ability to create new transactions.
@@ -792,7 +752,7 @@ public:
* from coin_control and Coin Selection if successful.
*/
bool SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAmount& nTargetValue, std::set<CInputCoin>& setCoinsRet, CAmount& nValueRet,
- const CCoinControl& coin_control, CoinSelectionParams& coin_selection_params, bool& bnb_used) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
+ const CCoinControl& coin_control, CoinSelectionParams& coin_selection_params) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
/** Get a name for this wallet for logging/debugging purposes.
*/
@@ -881,7 +841,7 @@ public:
* param@[out] nValueRet Used to return the total value of selected coins.
*/
bool SelectCoinsMinConf(const CAmount& nTargetValue, const CoinEligibilityFilter& eligibility_filter, std::vector<COutput> coins,
- std::set<CInputCoin>& setCoinsRet, CAmount& nValueRet, const CoinSelectionParams& coin_selection_params, bool& bnb_used) const;
+ std::set<CInputCoin>& setCoinsRet, CAmount& nValueRet, const CoinSelectionParams& coin_selection_params) const;
bool IsSpent(const uint256& hash, unsigned int n) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
@@ -889,7 +849,7 @@ public:
bool IsSpentKey(const uint256& hash, unsigned int n) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
void SetSpentKeyState(WalletBatch& batch, const uint256& hash, unsigned int n, bool used, std::set<CTxDestination>& tx_destinations) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);
- std::vector<OutputGroup> GroupOutputs(const std::vector<COutput>& outputs, bool separate_coins, const CFeeRate& effective_feerate, const CFeeRate& long_term_feerate, const CoinEligibilityFilter& filter, bool positive_only) const;
+ std::vector<OutputGroup> GroupOutputs(const std::vector<COutput>& outputs, const CoinSelectionParams& coin_sel_params, const CoinEligibilityFilter& filter, bool positive_only) const;
/** Display address on an external signer. Returns false if external signer support is not compiled */
bool DisplayAddress(const CTxDestination& dest) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet);