mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Merge #15557: Enhance bumpfee
to include inputs when targeting a feerate
184f8785f wallet_bumpfee.py: add test for change key preservation (Gregory Sanders) d08becff8 add functional tests for feerate bumpfee with adding inputs (Gregory Sanders) 0ea47ba7b generalize bumpfee to add inputs when needed (Gregory Sanders) Pull request description: When targeting a feerate using `bumpfee`, call a new function that directly uses `CWallet::CreateTransaction` and coin control to get the desired result. This allows us to get a superset of previous behavior, with an arbitrary RBF bump of a transaction provided it passes the preconditional checks and spare confirmed utxos are available. Note(s): 0) The coin selection will use knapsack solver for the residual selection. 1) This functionality, just like knapsack coin selection in general, will hoover up negative-value inputs when given the chance. 2) Newly added inputs must be confirmed due to current Core policy. See error: `replacement-adds-unconfirmed` 3) Supporting this with `totalFee` is difficult since the "minimum total fee" option in `CreateTransaction` logic was (rightly)taken out in #10390 . ACKs for commit 184f87: jnewbery: utACK 184f8785f710d58d9ef82e611591c9cbff5ab89d Tree-SHA512: fb6542bdfb2c6010e328ec475cf9dcbff4eb2b1a1b27f78010214534908987a5635797196fa05edddffcbcf2987335872dc644a99261886d5cbb34a8f262ad3e
This commit is contained in:
parent
b3f0ec5694
commit
7975686b0e
@ -49,6 +49,8 @@ public:
|
||||
bool m_avoid_partial_spends;
|
||||
//! Fee estimation mode to control arguments to estimateSmartFee
|
||||
FeeEstimateMode m_fee_mode;
|
||||
//! Minimum chain depth value for coin availability
|
||||
int m_min_depth{0};
|
||||
//! Controls which types of coins are allowed to be used (default: ALL_COINS)
|
||||
CoinType nCoinType;
|
||||
|
||||
|
@ -3627,7 +3627,7 @@ bool CWallet::CreateTransaction(interfaces::Chain::Lock& locked_chain, const std
|
||||
{
|
||||
CAmount nAmountAvailable{0};
|
||||
std::vector<COutput> vAvailableCoins;
|
||||
AvailableCoins(*locked_chain, vAvailableCoins, true, &coin_control);
|
||||
AvailableCoins(*locked_chain, vAvailableCoins, true, &coin_control, 1, MAX_MONEY, MAX_MONEY, 0, coin_control.m_min_depth);
|
||||
CoinSelectionParams coin_selection_params; // Parameters for coin selection, init with dummy
|
||||
coin_selection_params.use_bnb = false; // never use BnB
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user