diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -1510,12 +1510,6 @@ } } -static std::string ResolveErrMsg(const char *const optname, - const std::string &strBind) { - return strprintf(_("Cannot resolve -%s address: '%s'").translated, optname, - strBind); -} - /** * Initialize global loggers. * diff --git a/src/net_permissions.cpp b/src/net_permissions.cpp --- a/src/net_permissions.cpp +++ b/src/net_permissions.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -100,8 +101,7 @@ const std::string strBind = str.substr(offset); CService addrBind; if (!Lookup(strBind.c_str(), addrBind, 0, false)) { - error = strprintf(_("Cannot resolve -%s address: '%s'").translated, - "whitebind", strBind); + error = ResolveErrMsg("whitebind", strBind); return false; } if (addrBind.GetPort() == 0) { diff --git a/src/util/error.h b/src/util/error.h --- a/src/util/error.h +++ b/src/util/error.h @@ -10,7 +10,7 @@ * string functions. Types and functions defined here should not require any * outside dependencies. * - * Error types defined here can be used in different parts of the bitcoin + * Error types defined here can be used in different parts of the * codebase, to avoid the need to write boilerplate code catching and * translating errors passed across wallet/node/rpc/gui code boundaries. */ @@ -35,6 +35,9 @@ std::string TransactionErrorString(TransactionError error); +std::string ResolveErrMsg(const std::string &optname, + const std::string &strBind); + bilingual_str AmountHighWarn(const std::string &optname); bilingual_str AmountErrMsg(const std::string &optname, diff --git a/src/util/error.cpp b/src/util/error.cpp --- a/src/util/error.cpp +++ b/src/util/error.cpp @@ -35,6 +35,12 @@ assert(false); } +std::string ResolveErrMsg(const std::string &optname, + const std::string &strBind) { + return strprintf(_("Cannot resolve -%s address: '%s'").translated, optname, + strBind); +} + bilingual_str AmountHighWarn(const std::string &optname) { return strprintf(_("%s is set very high!"), optname); }