29 static const std::map<FeeReason, std::string> fee_reason_strings = {
40 auto reason_string = fee_reason_strings.find(reason);
42 if (reason_string == fee_reason_strings.end())
return "Unknown";
44 return reason_string->second;
47const std::vector<std::pair<std::string, FeeEstimateMode>>&
FeeModeMap()
49 static const std::vector<std::pair<std::string, FeeEstimateMode>> FEE_MODES = {
57std::string
FeeModeInfo(
const std::pair<std::string, FeeEstimateMode>& mode, std::string& default_info)
59 switch (mode.second) {
61 return strprintf(
"%s means no mode set (%s). \n", mode.first, default_info);
63 return strprintf(
"%s estimates use a shorter time horizon, making them more\n"
64 "responsive to short-term drops in the prevailing fee market. This mode\n"
65 "potentially returns a lower fee rate estimate.\n", mode.first);
67 return strprintf(
"%s estimates use a longer time horizon, making them\n"
68 "less responsive to short-term drops in the prevailing fee market. This mode\n"
69 "potentially returns a higher fee rate estimate.\n", mode.first);
85std::string
FeeModes(
const std::string& delimiter)
87 return Join(
FeeModeMap(), delimiter, [&](
const std::pair<std::string, FeeEstimateMode>& i) {
return i.first; });
92 return "Invalid estimate_mode parameter, must be one of: \"" +
FeeModes(
"\", \"") +
"\"";
97 auto searchkey =
ToUpper(mode_string);
99 if (
ToUpper(pair.first) == searchkey) {
100 fee_estimate_mode = pair.second;
113 return Untranslated(
"Specified sighash value does not match value stored in PSBT");
121 return Untranslated(
"Input needs additional signatures or other data");
132 case TransactionError::OK:
134 case TransactionError::MISSING_INPUTS:
136 case TransactionError::ALREADY_IN_UTXO_SET:
137 return Untranslated(
"Transaction outputs already in utxo set");
138 case TransactionError::MEMPOOL_REJECTED:
140 case TransactionError::MEMPOOL_ERROR:
142 case TransactionError::MAX_FEE_EXCEEDED:
143 return Untranslated(
"Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)");
144 case TransactionError::MAX_BURN_EXCEEDED:
145 return Untranslated(
"Unspendable output exceeds maximum configured by user (maxburnamount)");
146 case TransactionError::INVALID_PACKAGE:
147 return Untranslated(
"Transaction rejected due to invalid package");
155 return strprintf(
_(
"Cannot resolve -%s address: '%s'"), optname, strBind);
160 return strprintf(
_(
"Invalid port specified in %s: '%s'"), optname, invalid_value);
165 return strprintf(
_(
"%s is set very high!"), optname);
170 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)
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)
bool FeeModeFromString(std::string_view mode_string, FeeEstimateMode &fee_estimate_mode)
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 internally by node code,...
consteval auto _(util::TranslatedLiteral str)
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.