29 static const std::map<FeeReason, std::string> fee_reason_strings = {
36 auto reason_string = fee_reason_strings.find(reason);
38 if (reason_string == fee_reason_strings.end())
return "Unknown";
40 return reason_string->second;
43const std::vector<std::pair<std::string, FeeEstimateMode>>&
FeeModeMap()
45 static const std::vector<std::pair<std::string, FeeEstimateMode>> FEE_MODES = {
53std::string
FeeModeInfo(
const std::pair<std::string, FeeEstimateMode>& mode, std::string& default_info)
55 switch (mode.second) {
57 return strprintf(
"%s means no mode set (%s). \n", mode.first, default_info);
59 return strprintf(
"%s mode potentially returns a lower fee rate estimate.\n", mode.first);
61 return strprintf(
"%s potentially returns a higher fee rate estimate.\n", mode.first);
75std::string
FeeModes(
const std::string& delimiter)
77 return Join(
FeeModeMap(), delimiter, [&](
const std::pair<std::string, FeeEstimateMode>& i) {
return i.first; });
82 return "Invalid estimate_mode parameter, must be one of: \"" +
FeeModes(
"\", \"") +
"\"";
87 auto searchkey =
ToUpper(mode_string);
89 if (
ToUpper(pair.first) == searchkey) {
90 fee_estimate_mode = pair.second;
103 return Untranslated(
"Specified sighash value does not match value stored in PSBT");
111 return Untranslated(
"Input needs additional signatures or other data");
121 case TransactionError::OK:
123 case TransactionError::MISSING_INPUTS:
125 case TransactionError::ALREADY_IN_UTXO_SET:
126 return Untranslated(
"Transaction outputs already in utxo set");
127 case TransactionError::MEMPOOL_REJECTED:
129 case TransactionError::MEMPOOL_ERROR:
131 case TransactionError::MAX_FEE_EXCEEDED:
132 return Untranslated(
"Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)");
133 case TransactionError::MAX_BURN_EXCEEDED:
134 return Untranslated(
"Unspendable output exceeds maximum configured by user (maxburnamount)");
135 case TransactionError::INVALID_PACKAGE:
136 return Untranslated(
"Transaction rejected due to invalid package");
137 case TransactionError::PRIVATE_BROADCAST_FULL:
145 return strprintf(
_(
"Cannot resolve -%s address: '%s'"), optname, strBind);
150 return strprintf(
_(
"Invalid port specified in %s: '%s'"), optname, invalid_value);
155 return strprintf(
_(
"%s is set very high!"), optname);
160 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 Fee rate estimator to return conservative estimates.
@ UNSET
Use default settings based on other criteria.
@ ECONOMICAL
Force Fee rate estimator to return non-conservative estimates.
std::string ToUpper(std::string_view str)
Returns the uppercase equivalent of the given string.