MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / validate

Method validate

src/qt/optionsdialog.cpp:474–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472}
473
474QValidator::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}

Callers 3

checkValidityMethod · 0.45
isValidMethod · 0.45
PrepareSendTextMethod · 0.45

Calls 4

SplitHostPortFunction · 0.85
LookupNumericFunction · 0.85
ProxyClass · 0.50
IsValidMethod · 0.45

Tested by

no test coverage detected