diff options
author | Andrew Chow <achow101-github@achow101.com> | 2021-05-20 16:54:23 -0400 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2021-08-27 12:46:04 -0400 |
commit | 54de7b47463d98f860167d4e0b7e4ebb3926b59c (patch) | |
tree | bd4fa1cf13689cfc6ecbee4153632d03d8dabac8 /src/wallet/wallet.cpp | |
parent | eb09c26724e3f714b613788fc506f2ff3a208d2c (diff) | |
download | bitcoin-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/wallet.cpp')
-rw-r--r-- | src/wallet/wallet.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index dbcfc4dac3..c33cc9e164 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2701,6 +2701,15 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri walletInstance->m_default_max_tx_fee = max_fee.value(); } + if (gArgs.IsArgSet("-consolidatefeerate")) { + if (std::optional<CAmount> consolidate_feerate = ParseMoney(gArgs.GetArg("-consolidatefeerate", ""))) { + walletInstance->m_consolidate_feerate = CFeeRate(*consolidate_feerate); + } else { + error = AmountErrMsg("consolidatefeerate", gArgs.GetArg("-consolidatefeerate", "")); + return nullptr; + } + } + if (chain && chain->relayMinFee().GetFeePerK() > HIGH_TX_FEE_PER_KB) { warnings.push_back(AmountHighWarn("-minrelaytxfee") + Untranslated(" ") + _("The wallet will avoid paying less than the minimum relay fee.")); |