aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/spend.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2021-05-20 16:54:23 -0400
committerAndrew Chow <achow101-github@achow101.com>2021-08-27 12:46:04 -0400
commit54de7b47463d98f860167d4e0b7e4ebb3926b59c (patch)
treebd4fa1cf13689cfc6ecbee4153632d03d8dabac8 /src/wallet/spend.cpp
parenteb09c26724e3f714b613788fc506f2ff3a208d2c (diff)
downloadbitcoin-54de7b47463d98f860167d4e0b7e4ebb3926b59c.tar.xz
Allow the long term feerate to be configured, default of 10 sat/vb
The long term feerate is really the highest feerate that the user is comfortable with making consolidatory transactions. This is should thus be something that can be configured by the user via a new startup option -consolidatefeerate. The default value is 10 sat/vbyte, chosen arbitrarily (it seems like a reasonable number).
Diffstat (limited to 'src/wallet/spend.cpp')
-rw-r--r--src/wallet/spend.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp
index 3bb7134b24..3ccb6d6391 100644
--- a/src/wallet/spend.cpp
+++ b/src/wallet/spend.cpp
@@ -586,6 +586,9 @@ bool CWallet::CreateTransactionInternal(
CoinSelectionParams coin_selection_params; // Parameters for coin selection, init with dummy
coin_selection_params.m_avoid_partial_spends = coin_control.m_avoid_partial_spends;
+ // Set the long term feerate estimate to the wallet's consolidate feerate
+ coin_selection_params.m_long_term_feerate = m_consolidate_feerate;
+
CAmount recipients_sum = 0;
const OutputType change_type = TransactionChangeType(coin_control.m_change_type ? *coin_control.m_change_type : m_default_change_type, vecSend);
ReserveDestination reservedest(this, change_type);
@@ -659,11 +662,6 @@ bool CWallet::CreateTransactionInternal(
return false;
}
- // Get long term estimate
- CCoinControl cc_temp;
- cc_temp.m_confirm_target = chain().estimateMaxBlocks();
- coin_selection_params.m_long_term_feerate = GetMinimumFeeRate(*this, cc_temp, nullptr);
-
// Calculate the cost of change
// Cost of change is the cost of creating the change output + cost of spending the change output in the future.
// For creating the change output now, we use the effective feerate.