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).
This commit is contained in:
Andrew Chow
2021-05-20 16:54:23 -04:00
parent eb09c26724
commit 54de7b4746
5 changed files with 22 additions and 5 deletions

View File

@@ -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."));