28 static const std::map<FeeReason, std::string> fee_reason_strings = {
39 auto reason_string = fee_reason_strings.find(reason);
41 if (reason_string == fee_reason_strings.end())
return "Unknown";
43 return reason_string->second;
46const std::vector<std::pair<std::string, FeeEstimateMode>>&
FeeModeMap()
48 static const std::vector<std::pair<std::string, FeeEstimateMode>> FEE_MODES = {
56std::string
FeeModeInfo(
const std::pair<std::string, FeeEstimateMode>& mode, std::string& default_info)
58 switch (mode.second) {
60 return strprintf(
"%s means no mode set (%s). \n", mode.first, default_info);
62 return strprintf(
"%s estimates use a shorter time horizon, making them more\n"
63 "responsive to short-term drops in the prevailing fee market. This mode\n"
64 "potentially returns a lower fee rate estimate.\n", mode.first);
66 return strprintf(
"%s estimates use a longer time horizon, making them\n"
67 "less responsive to short-term drops in the prevailing fee market. This mode\n"
68 "potentially returns a higher fee rate estimate.\n", mode.first);
84std::string
FeeModes(
const std::string& delimiter)
86 return Join(
FeeModeMap(), delimiter, [&](
const std::pair<std::string, FeeEstimateMode>& i) {
return i.first; });
91 return "Invalid estimate_mode parameter, must be one of: \"" +
FeeModes(
"\", \"") +
"\"";
96 auto searchkey =
ToUpper(mode_string);
98 if (
ToUpper(pair.first) == searchkey) {
99 fee_estimate_mode = pair.second;
112 return Untranslated(
"Specified sighash value does not match value stored in PSBT");
127 case TransactionError::OK:
129 case TransactionError::MISSING_INPUTS:
131 case TransactionError::ALREADY_IN_UTXO_SET:
132 return Untranslated(
"Transaction outputs already in utxo set");
133 case TransactionError::MEMPOOL_REJECTED:
135 case TransactionError::MEMPOOL_ERROR:
137 case TransactionError::MAX_FEE_EXCEEDED:
138 return Untranslated(
"Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)");
139 case TransactionError::MAX_BURN_EXCEEDED:
140 return Untranslated(
"Unspendable output exceeds maximum configured by user (maxburnamount)");
141 case TransactionError::INVALID_PACKAGE:
142 return Untranslated(
"Transaction rejected due to invalid package");
150 return strprintf(
_(
"Cannot resolve -%s address: '%s'"), optname, strBind);
155 return strprintf(
_(
"Invalid port specified in %s: '%s'"), optname, invalid_value);
160 return strprintf(
_(
"%s is set very high!"), optname);
165 return strprintf(
_(
"Invalid amount for -%s=<amount>: '%s'"), optname, strValue);
is a home for simple enum and struct type definitions that can be used internally by functions in the...
@ CONSERVATIVE
Force estimateSmartFee to use conservative estimates.
@ UNSET
Use default settings based on other criteria.
@ ECONOMICAL
Force estimateSmartFee to use non-conservative estimates.
is a home for simple string functions returning descriptive messages that are used in RPC and GUI int...
@ EXTERNAL_SIGNER_NOT_FOUND
bilingual_str PSBTErrorString(PSBTError err)
bool FeeModeFromString(const std::string &mode_string, FeeEstimateMode &fee_estimate_mode)
std::string FeeModesDetail(std::string default_info)
std::string FeeModeInfo(const std::pair< std::string, FeeEstimateMode > &mode, std::string &default_info)
bilingual_str TransactionErrorString(const TransactionError err)
std::string FeeModes(const std::string &delimiter)
bilingual_str AmountErrMsg(const std::string &optname, const std::string &strValue)
std::string InvalidEstimateModeErrorMessage()
bilingual_str ResolveErrMsg(const std::string &optname, const std::string &strBind)
const std::vector< std::pair< std::string, FeeEstimateMode > > & FeeModeMap()
std::string StringForFeeReason(FeeReason reason)
bilingual_str AmountHighWarn(const std::string &optname)
bilingual_str InvalidPortErrMsg(const std::string &optname, const std::string &invalid_value)
auto Join(const C &container, const S &separator, UnaryOp unary_op)
Join all container items.
is a home for public enum and struct type definitions that are used by internally by node code,...
bilingual_str _(ConstevalStringLiteral str)
Translation function.
bilingual_str Untranslated(std::string original)
Mark a bilingual_str as untranslated.
std::string ToUpper(std::string_view str)
Returns the uppercase equivalent of the given string.