mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Validate port options
Check `port` options for invalid values (ports are parsed as uint16, so in practice values >65535 are invalid; port 0 is undefined and therefore considered invalid too). This allows for an early rejection of faulty values and an supplying an informative message to the user. Splits tests in `feature_proxy.py` to cover both invalid `hostname` and `port` values. Adds a release-note as previously valid `-port` and `-rpcport` values can now result in errors.
This commit is contained in:
committed by
Amadeusz Pawlik
parent
f8387c4234
commit
04526787b5
@@ -49,6 +49,11 @@ bilingual_str ResolveErrMsg(const std::string& optname, const std::string& strBi
|
||||
return strprintf(_("Cannot resolve -%s address: '%s'"), optname, strBind);
|
||||
}
|
||||
|
||||
bilingual_str InvalidPortErrMsg(const std::string& optname, const std::string& invalid_value)
|
||||
{
|
||||
return strprintf(_("Invalid port specified in %s: '%s'"), optname, invalid_value);
|
||||
}
|
||||
|
||||
bilingual_str AmountHighWarn(const std::string& optname)
|
||||
{
|
||||
return strprintf(_("%s is set very high!"), optname);
|
||||
|
||||
@@ -39,6 +39,8 @@ bilingual_str TransactionErrorString(const TransactionError error);
|
||||
|
||||
bilingual_str ResolveErrMsg(const std::string& optname, const std::string& strBind);
|
||||
|
||||
bilingual_str InvalidPortErrMsg(const std::string& optname, const std::string& strPort);
|
||||
|
||||
bilingual_str AmountHighWarn(const std::string& optname);
|
||||
|
||||
bilingual_str AmountErrMsg(const std::string& optname, const std::string& strValue);
|
||||
|
||||
Reference in New Issue
Block a user