| 82 | } |
| 83 | |
| 84 | bool NetWhitebindPermissions::TryParse(const std::string& str, NetWhitebindPermissions& output, bilingual_str& error) |
| 85 | { |
| 86 | NetPermissionFlags flags; |
| 87 | size_t offset; |
| 88 | if (!TryParsePermissionFlags(str, flags, offset, error)) return false; |
| 89 | |
| 90 | const std::string strBind = str.substr(offset); |
| 91 | CService addrBind; |
| 92 | if (!Lookup(strBind, addrBind, 0, false)) { |
| 93 | error = ResolveErrMsg("whitebind", strBind); |
| 94 | return false; |
| 95 | } |
| 96 | if (addrBind.GetPort() == 0) { |
| 97 | error = strprintf(_("Need to specify a port with -whitebind: '%s'"), strBind); |
| 98 | return false; |
| 99 | } |
| 100 | |
| 101 | output.m_flags = flags; |
| 102 | output.m_service = addrBind; |
| 103 | error = Untranslated(""); |
| 104 | return true; |
| 105 | } |
| 106 | |
| 107 | bool NetWhitelistPermissions::TryParse(const std::string& str, NetWhitelistPermissions& output, bilingual_str& error) |
| 108 | { |
nothing calls this directly
no test coverage detected