30 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);
83std::string
FeeModes(
const std::string& delimiter)
85 return Join(
FeeModeMap(), delimiter, [&](
const std::pair<std::string, FeeEstimateMode>& i) {
return i.first; });
90 return "Invalid estimate_mode parameter, must be one of: \"" +
FeeModes(
"\", \"") +
"\"";
95 auto searchkey =
ToUpper(mode_string);
97 if (
ToUpper(pair.first) == searchkey) {
98 fee_estimate_mode = pair.second;
111 return Untranslated(
"Specified sighash value does not match value stored in PSBT");
119 return Untranslated(
"Input needs additional signatures or other data");
131 case TransactionError::OK:
133 case TransactionError::MISSING_INPUTS:
135 case TransactionError::ALREADY_IN_UTXO_SET:
136 return Untranslated(
"Transaction outputs already in utxo set");
137 case TransactionError::MEMPOOL_REJECTED:
139 case TransactionError::MEMPOOL_ERROR:
141 case TransactionError::MAX_FEE_EXCEEDED:
142 return Untranslated(
"Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)");
143 case TransactionError::MAX_BURN_EXCEEDED:
144 return Untranslated(
"Unspendable output exceeds maximum configured by user (maxburnamount)");
145 case TransactionError::INVALID_PACKAGE:
146 return Untranslated(
"Transaction rejected due to invalid package");
147 case TransactionError::PRIVATE_BROADCAST_FULL:
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...
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.
@ CONSERVATIVE
Force estimateSmartFee to use conservative estimates.
@ UNSET
Use default settings based on other criteria.
@ ECONOMICAL
Force estimateSmartFee to use non-conservative estimates.
std::string ToUpper(std::string_view str)
Returns the uppercase equivalent of the given string.