From 54de7b47463d98f860167d4e0b7e4ebb3926b59c Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Thu, 20 May 2021 16:54:23 -0400 Subject: 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). --- src/wallet/wallet.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/wallet/wallet.cpp') 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::Create(WalletContext& context, const std::stri walletInstance->m_default_max_tx_fee = max_fee.value(); } + if (gArgs.IsArgSet("-consolidatefeerate")) { + if (std::optional 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.")); -- cgit v1.2.3