| 472 | } |
| 473 | |
| 474 | QValidator::State ProxyAddressValidator::validate(QString &input, int &pos) const |
| 475 | { |
| 476 | Q_UNUSED(pos); |
| 477 | uint16_t port{0}; |
| 478 | std::string hostname; |
| 479 | if (!SplitHostPort(input.toStdString(), port, hostname) || port != 0) return QValidator::Invalid; |
| 480 | |
| 481 | CService serv(LookupNumeric(input.toStdString(), DEFAULT_GUI_PROXY_PORT)); |
| 482 | Proxy addrProxy = Proxy(serv, /*tor_stream_isolation=*/true); |
| 483 | if (addrProxy.IsValid()) |
| 484 | return QValidator::Acceptable; |
| 485 | |
| 486 | return QValidator::Invalid; |
| 487 | } |
no test coverage detected